├── README.md ├── docs ├── HOWTO │ ├── blinky.txt │ ├── clock7.txt │ ├── cpm.txt │ ├── gpio.txt │ ├── i2cspi.txt │ ├── putty.txt │ ├── start.txt │ ├── update.txt │ └── wire.txt ├── MakerLisp Language.pdf ├── MakerLisp Machine.pdf ├── Presentation.ppt ├── bom │ ├── cpu_bom.pdf │ ├── ioexp_bom.pdf │ ├── usb_bom.pdf │ └── vga_bom.pdf ├── license │ └── license.txt ├── manuals │ ├── mlbrief.rtf │ ├── mlmhwref.pdf │ ├── mlmswref.rtf │ └── mlmterm.rtf └── schematic │ ├── cpu_sch.pdf │ ├── ioexp_sch.pdf │ ├── usb_sch.pdf │ └── vga_sch.pdf ├── lisp.c ├── makerlisp.udb └── src ├── cpm ├── ascii.h ├── chario.c ├── chario.h ├── cpm.zdsproj ├── cpmchario.c ├── cpmchario.h ├── cpmdiskio.c ├── cpmdiskio.h ├── cpmdispatch.c ├── cpmdispatch.h ├── cpmload.c ├── cpmload.h ├── cpmregisters.h ├── cpmtable.c ├── cpmtable.h ├── disks.c ├── disks.h ├── eZ80-CPM-BDOS.inc ├── eZ80-CPM-BIOS.inc ├── eZ80-CPM-CCP.inc ├── eZ80-CPM-MDEF.inc ├── eZ80-CPM.asm ├── isrwrap.asm ├── isrwrap.h ├── main.c ├── middle.asm ├── middle.h ├── sdparams.h ├── stringio.c ├── stringio.h └── zsldevinit.asm ├── fatfs ├── LICENSE.txt ├── documents │ ├── 00index_e.html │ ├── css_e.css │ ├── doc │ │ ├── appnote.html │ │ ├── chdir.html │ │ ├── chdrive.html │ │ ├── chmod.html │ │ ├── close.html │ │ ├── closedir.html │ │ ├── config.html │ │ ├── dinit.html │ │ ├── dioctl.html │ │ ├── dread.html │ │ ├── dstat.html │ │ ├── dwrite.html │ │ ├── eof.html │ │ ├── error.html │ │ ├── expand.html │ │ ├── fattime.html │ │ ├── fdisk.html │ │ ├── filename.html │ │ ├── findfirst.html │ │ ├── findnext.html │ │ ├── forward.html │ │ ├── getcwd.html │ │ ├── getfree.html │ │ ├── getlabel.html │ │ ├── gets.html │ │ ├── lseek.html │ │ ├── mkdir.html │ │ ├── mkfs.html │ │ ├── mount.html │ │ ├── open.html │ │ ├── opendir.html │ │ ├── printf.html │ │ ├── putc.html │ │ ├── puts.html │ │ ├── rc.html │ │ ├── read.html │ │ ├── readdir.html │ │ ├── rename.html │ │ ├── sdir.html │ │ ├── setcp.html │ │ ├── setlabel.html │ │ ├── sfatfs.html │ │ ├── sfile.html │ │ ├── sfileinfo.html │ │ ├── size.html │ │ ├── stat.html │ │ ├── sync.html │ │ ├── tell.html │ │ ├── truncate.html │ │ ├── unlink.html │ │ ├── utime.html │ │ └── write.html │ ├── res │ │ ├── app1.c │ │ ├── app2.c │ │ ├── app3.c │ │ ├── app4.c │ │ ├── f1.png │ │ ├── f2.png │ │ ├── f3.png │ │ ├── f4.png │ │ ├── f5.png │ │ ├── f6.png │ │ ├── f7.png │ │ ├── funcs.png │ │ ├── layers.png │ │ ├── layers1.png │ │ ├── layers2.png │ │ ├── layers3.png │ │ ├── mkfatimg.zip │ │ ├── mkfs.xls │ │ ├── modules.png │ │ ├── rwtest1.png │ │ ├── rwtest2.png │ │ └── rwtest3.png │ └── updates.txt └── source │ ├── 00history.txt │ ├── 00readme.txt │ ├── diskio.c │ ├── diskio.h │ ├── ff.c │ ├── ff.h │ ├── ffconf.h │ ├── ffsystem.c │ ├── ffunicode.c │ └── integer.h ├── libc └── stdio │ ├── stdio.c │ └── stdio.h ├── lisp ├── linux │ ├── Makefile │ ├── lisp.sh │ ├── platform.c │ ├── platform.h │ ├── runtests.sh │ └── tests │ │ ├── bubbleint.l │ │ ├── bubbleint.l.reference │ │ ├── cfold.l │ │ ├── cfold.l.reference │ │ ├── coroutine.l │ │ ├── coroutine.l.reference │ │ ├── fact.l │ │ ├── fact.l.reference │ │ ├── reader.l │ │ ├── reader.l.reference │ │ ├── tak.l │ │ ├── tak.l.reference │ │ ├── test.l │ │ ├── test.l.reference │ │ ├── tmapcar.l │ │ └── tmapcar.l.reference ├── lisp.c ├── lisp.zdsproj ├── platform.c ├── platform.h └── zsldevinit.asm ├── mlmhw ├── mlmhw.c └── mlmhw.h ├── uSDimage ├── cpm │ ├── archive │ │ ├── aztec106d.zip │ │ ├── ccgames.zip │ │ └── cpm22-b.zip │ ├── aztec106d │ │ ├── ARCV.COM │ │ ├── AS.COM │ │ ├── C.LIB │ │ ├── CC.COM │ │ ├── CC.MSG │ │ ├── CNM.COM │ │ ├── CRC.COM │ │ ├── CZ.COM │ │ ├── EXMPL.C │ │ ├── HEADER.ARC │ │ ├── HEX80.COM │ │ ├── LIBASRC.ARC │ │ ├── LIBC.REL │ │ ├── LIBCSRC.ARC │ │ ├── LIBUTIL.COM │ │ ├── LN.COM │ │ ├── M.LIB │ │ ├── MATH.REL │ │ ├── MATHSRC.ARC │ │ ├── OVBGN.O │ │ ├── OVLOADER.O │ │ ├── OVLY.ARC │ │ ├── R.O │ │ ├── RBEGIN.O │ │ ├── RBUILD.SUB │ │ ├── REXT.ASM │ │ ├── ROM.LIB │ │ ├── SIDSYM.COM │ │ ├── SQZ.COM │ │ ├── T.LIB │ │ └── TINYSRC.ARC │ ├── ccgames │ │ ├── DISK1 │ │ │ ├── ACEYDUCY.BAS │ │ │ ├── AMAZING.BAS │ │ │ ├── AMAZINGP.BAS │ │ │ ├── ANIMAL.BAS │ │ │ ├── AWARI.BAS │ │ │ ├── BAGELS.BAS │ │ │ ├── BANNER.BAS │ │ │ ├── BASKETBL.BAS │ │ │ ├── BATNUM.BAS │ │ │ ├── BATTLE.BAS │ │ │ ├── BLACKJCK.BAS │ │ │ ├── BOMBARD.BAS │ │ │ ├── BOMBSAWY.BAS │ │ │ ├── BOUNCE.BAS │ │ │ ├── BOWLING.BAS │ │ │ ├── BOXING.BAS │ │ │ ├── BUG.BAS │ │ │ ├── BULLFGHT.BAS │ │ │ ├── BULLSEYE.BAS │ │ │ ├── BUNNY.BAS │ │ │ ├── BUZZWORD.BAS │ │ │ ├── CALENDAR.BAS │ │ │ ├── CHANGE.BAS │ │ │ ├── CHECKERS.BAS │ │ │ ├── CHEMIST.BAS │ │ │ ├── CHIEF.BAS │ │ │ ├── CHOMP.BAS │ │ │ ├── CIVILWAR.BAS │ │ │ ├── COMBAT.BAS │ │ │ ├── CRAPS.BAS │ │ │ ├── CUBE.BAS │ │ │ ├── DEPTHCHG.BAS │ │ │ ├── DIAMOND.BAS │ │ │ ├── DICE.BAS │ │ │ ├── DIGITS.BAS │ │ │ ├── EVENWIN1.BAS │ │ │ ├── EVENWIN2.BAS │ │ │ ├── FLIPFLOP.BAS │ │ │ ├── FOOTBAL1.BAS │ │ │ ├── FOOTBAL2.BAS │ │ │ ├── FURTRADR.BAS │ │ │ ├── GOLF.BAS │ │ │ ├── GOMOKO.BAS │ │ │ ├── GUESS.BAS │ │ │ ├── GUNNER.BAS │ │ │ ├── HAMURABI.BAS │ │ │ ├── HANGMAN.BAS │ │ │ ├── HELLO.BAS │ │ │ ├── HEXAPAWN.BAS │ │ │ ├── HI-Q.BAS │ │ │ ├── HILO.BAS │ │ │ ├── HOCKEY.BAS │ │ │ └── MENU.BAS │ │ ├── DISK2 │ │ │ ├── 23-MATCH.BAS │ │ │ ├── DSPACE.BAS │ │ │ ├── GRANPRIX.BAS │ │ │ ├── HOCKEY1.BAS │ │ │ ├── HORSRACE.BAS │ │ │ ├── HURKLE.BAS │ │ │ ├── KINEMA.BAS │ │ │ ├── KING.BAS │ │ │ ├── LEM.BAS │ │ │ ├── LETTER.BAS │ │ │ ├── LIFE2.BAS │ │ │ ├── LITQUIZ.BAS │ │ │ ├── LOVE-P.BAS │ │ │ ├── LOVE.BAS │ │ │ ├── MADLIBS.BAS │ │ │ ├── MASTRMND.BAS │ │ │ ├── MATHDICE.BAS │ │ │ ├── MENU.BAS │ │ │ ├── MUGWUMP.BAS │ │ │ ├── NAME.BAS │ │ │ ├── NICOMA.BAS │ │ │ ├── NIM.BAS │ │ │ ├── NUMBER.BAS │ │ │ ├── ONECHECK.BAS │ │ │ ├── ORBIT.BAS │ │ │ ├── PIZZA.BAS │ │ │ ├── POETRY.BAS │ │ │ ├── POKER.BAS │ │ │ ├── QUBIC.BAS │ │ │ ├── QUEEN.BAS │ │ │ ├── REVERSE.BAS │ │ │ ├── ROCKSP.BAS │ │ │ ├── ROULETTE.BAS │ │ │ ├── RUSROU.BAS │ │ │ ├── SALVO.BAS │ │ │ ├── SINEWAVE.BAS │ │ │ ├── SLALOM.BAS │ │ │ ├── SPLAT.BAS │ │ │ ├── STARS.BAS │ │ │ ├── STOCK.BAS │ │ │ ├── SYNONYM.BAS │ │ │ ├── TARGET.BAS │ │ │ ├── TICTAC1.BAS │ │ │ ├── TICTAC2.BAS │ │ │ ├── TOWERS.BAS │ │ │ ├── TRAIN.BAS │ │ │ ├── TRAP.BAS │ │ │ ├── WAR.BAS │ │ │ ├── WEEKDAY.BAS │ │ │ ├── WORD.BAS │ │ │ └── YAHTZEE.BAS │ │ ├── FILE_ID.DIZ │ │ └── README.TXT │ ├── cpm22utl │ │ ├── ASM.COM │ │ ├── DDT.COM │ │ ├── DSKMAINT.COM │ │ ├── DUMP.ASM │ │ ├── DUMP.COM │ │ ├── ED.COM │ │ ├── LOAD.COM │ │ ├── PIP.COM │ │ ├── STAT.COM │ │ ├── SUBMIT.COM │ │ └── XSUB.COM │ ├── diskimg │ │ ├── diskdefs │ │ └── images.zip │ ├── doc │ │ ├── Aztec_C_1.06_User_Manual_Mar84.pdf │ │ ├── cpm22-m.pdf │ │ └── mbasic-80.pdf │ ├── mbasic │ │ ├── ascii.bas │ │ └── mbasic.com │ └── romutil │ │ ├── cpm.rom │ │ ├── ez80.h │ │ ├── lisp.rom │ │ ├── romcmp.c │ │ ├── romimg.c │ │ └── romupd.c └── lisp │ ├── bin │ ├── blankrom.l │ ├── cat.l │ ├── cload.l │ ├── cls.l │ ├── color.l │ ├── date.l │ ├── dc.l │ ├── delay.l │ ├── edit.l │ ├── kbcmp.l │ ├── kbimg.l │ ├── kbupd.l │ ├── ls.l │ ├── romcmp.l │ ├── romimg.l │ ├── romupd.l │ ├── rv.l │ ├── termid.l │ ├── time.l │ ├── vgacmp.l │ ├── vgaimg.l │ └── vgaupd.l │ ├── demo │ ├── benchtak.l │ ├── blinky.l │ ├── chartest.l │ ├── clock7.l │ ├── colordemo.l │ ├── fact.l │ ├── fcat.l │ ├── hello.l │ ├── i2cbus.l │ ├── led.l │ ├── loopsieve.l │ ├── looptemp.l │ ├── looptime.l │ ├── oshyard.l │ ├── shyard.l │ ├── sieve.l │ ├── spidev.l │ ├── stack.l │ └── wp.l │ ├── etc │ ├── cpm.rom │ ├── cpmdiska.img │ ├── rom │ ├── usbkb.rom │ ├── vga1024.rom │ ├── vga640.rom │ └── vga720.rom │ └── l │ ├── clib │ ├── #fseek.l# │ ├── atoi.l │ ├── ceil.l │ ├── fclose.l │ ├── fgetc.l │ ├── floor.l │ ├── fopen.l │ ├── fputc.l │ ├── fseek.l │ ├── getchar.l │ ├── isalpha.l │ ├── isdigit.l │ ├── isspace.l │ ├── pow.l │ ├── putchar.l │ ├── rewind.l │ ├── sprintf.l │ ├── sqrt.l │ ├── stderr.l │ ├── stdin.l │ ├── stdio.l │ ├── stdout.l │ ├── toupper.l │ └── ungetc.l │ ├── ez80 │ ├── FLASH_COL.l │ ├── FLASH_DATA.l │ ├── FLASH_FDIV.l │ ├── FLASH_KEY.l │ ├── FLASH_PAGE.l │ ├── FLASH_PGCTL.l │ ├── FLASH_PROT.l │ ├── FLASH_ROW.l │ ├── PA_ALT1.l │ ├── PA_ALT2.l │ ├── PA_DDR.l │ ├── PA_DR.l │ ├── PB_ALT1.l │ ├── PB_ALT2.l │ ├── PB_DDR.l │ ├── PB_DR.l │ ├── PC_ALT1.l │ ├── PC_ALT2.l │ ├── PC_DDR.l │ ├── PC_DR.l │ ├── PD_ALT1.l │ ├── PD_ALT2.l │ ├── PD_DDR.l │ ├── PD_DR.l │ ├── RTC_CEN.l │ ├── RTC_CTRL.l │ ├── RTC_DOM.l │ ├── RTC_DOW.l │ ├── RTC_HRS.l │ ├── RTC_MIN.l │ ├── RTC_MON.l │ ├── RTC_SEC.l │ ├── RTC_YR.l │ ├── gpin.l │ ├── gpod.l │ ├── gpout.l │ ├── regbclr.l │ ├── regbmask.l │ ├── regbread.l │ ├── regbset.l │ └── regbwrite.l │ ├── lang │ ├── _greater.l │ ├── _greaterorequal.l │ ├── _land.l │ ├── _lessorequal.l │ ├── _lor.l │ ├── add.l │ ├── and.l │ ├── append.l │ ├── apply.l │ ├── arithmetic.l │ ├── assoc.l │ ├── assq.l │ ├── atom.l │ ├── backquote.l │ ├── caaaar.l │ ├── caaadr.l │ ├── caaar.l │ ├── caadar.l │ ├── caaddr.l │ ├── caadr.l │ ├── caar.l │ ├── cadaar.l │ ├── cadadr.l │ ├── cadar.l │ ├── caddar.l │ ├── cadddr.l │ ├── caddr.l │ ├── cadr.l │ ├── case.l │ ├── cats.l │ ├── cdaaar.l │ ├── cdaadr.l │ ├── cdaar.l │ ├── cdadar.l │ ├── cdaddr.l │ ├── cdadr.l │ ├── cdar.l │ ├── cddaar.l │ ├── cddadr.l │ ├── cddar.l │ ├── cdddar.l │ ├── cddddr.l │ ├── cdddr.l │ ├── cddr.l │ ├── cond.l │ ├── constant.l │ ├── div.l │ ├── eql.l │ ├── equal.l │ ├── explode.l │ ├── for.l │ ├── global.l │ ├── greater.l │ ├── greaterorequal.l │ ├── iand.l │ ├── implode.l │ ├── ior.l │ ├── ixor.l │ ├── length.l │ ├── less.l │ ├── lessorequal.l │ ├── let.l │ ├── lets.l │ ├── listp.l │ ├── mapcar.l │ ├── mul.l │ ├── n-ary.l │ ├── nlprint.l │ ├── nth.l │ ├── null.l │ ├── numberp.l │ ├── or.l │ ├── order-nary.l │ ├── reverse.l │ ├── sub.l │ ├── switch.l │ ├── vector.l │ ├── vector2list.l │ └── while.l │ └── util │ ├── author.l │ ├── autoload.l │ ├── debug.l │ ├── discard.l │ ├── expand.l │ ├── flatten.l │ ├── import.l │ ├── isloaded.l │ ├── load.l │ ├── makerlisp.l │ ├── nopatch.l │ ├── patchon.l │ ├── path.l │ ├── repl.l │ ├── trace.l │ ├── undebug.l │ ├── unload.l │ ├── untrace.l │ ├── user.l │ └── version.l ├── usbkey └── mla_v2017_03_06 │ ├── apps │ └── usb │ │ └── host │ │ └── hid_keyboard │ │ └── firmware │ │ ├── demo_src │ │ ├── app_host_hid_keyboard.c │ │ ├── app_host_hid_keyboard.h │ │ ├── main.c │ │ ├── system_config.h │ │ ├── usb_config.c │ │ └── usb_config.h │ │ ├── exp16_pic32mm0256gpm064_pim.x │ │ ├── Makefile │ │ ├── io_mapping.h │ │ ├── nbproject │ │ │ ├── Makefile-PIC32MM0256GPM064_PIM.mk │ │ │ ├── Makefile-genesis.properties │ │ │ ├── Makefile-impl.mk │ │ │ ├── Makefile-local-PIC32MM0256GPM064_PIM.mk │ │ │ ├── Makefile-variables.mk │ │ │ ├── Package-PIC32MM0256GPM064_PIM.bash │ │ │ ├── configurations.xml │ │ │ └── project.xml │ │ ├── system.c │ │ └── system.h │ │ └── mlm_usb_host.x │ │ ├── Makefile │ │ ├── io_mapping.h │ │ ├── nbproject │ │ ├── Makefile-MLM_USB_Host.mk │ │ ├── Makefile-genesis.properties │ │ ├── Makefile-impl.mk │ │ ├── Makefile-local-MLM_USB_Host.mk │ │ ├── Makefile-variables.mk │ │ ├── Package-MLM_USB_Host.bash │ │ ├── configurations.xml │ │ └── project.xml │ │ ├── system.c │ │ └── system.h │ ├── bsp │ ├── exp16 │ │ └── pic32mm0256gpm064_pim │ │ │ ├── fwupd.c │ │ │ ├── fwupd.h │ │ │ ├── hardware.txt │ │ │ ├── lcd.c │ │ │ ├── lcd.h │ │ │ ├── leds.c │ │ │ ├── leds.h │ │ │ ├── print_lcd.h │ │ │ ├── timer_1ms.c │ │ │ ├── timer_1ms.h │ │ │ ├── uart1.c │ │ │ └── uart1.h │ └── mlm_usb_host │ │ ├── fwupd.c │ │ ├── fwupd.h │ │ ├── lcd.c │ │ ├── lcd.h │ │ ├── leds.c │ │ ├── leds.h │ │ ├── print_lcd.h │ │ ├── timer_1ms.c │ │ ├── timer_1ms.h │ │ ├── uart1.c │ │ └── uart1.h │ ├── framework │ └── usb │ │ ├── doc │ │ ├── USB - Obtaining a WHQL Certified USB Driver Package.pdf │ │ ├── USB Driver Reseller Rights Request Form_030913.doc │ │ ├── help_mla_usb.jar │ │ └── help_mla_usb.pdf │ │ ├── inc │ │ ├── usb.h │ │ ├── usb_ch9.h │ │ ├── usb_common.h │ │ ├── usb_device.h │ │ ├── usb_device_audio.h │ │ ├── usb_device_ccid.h │ │ ├── usb_device_cdc.h │ │ ├── usb_device_generic.h │ │ ├── usb_device_hid.h │ │ ├── usb_device_midi.h │ │ ├── usb_device_msd.h │ │ ├── usb_device_phdc.h │ │ ├── usb_device_phdc_com_model.h │ │ ├── usb_hal.h │ │ ├── usb_hal_dspic33e.h │ │ ├── usb_hal_pic16f1.h │ │ ├── usb_hal_pic18.h │ │ ├── usb_hal_pic24.h │ │ ├── usb_hal_pic24e.h │ │ ├── usb_hal_pic24f.h │ │ ├── usb_hal_pic32mm.h │ │ ├── usb_hid.h │ │ ├── usb_host.h │ │ ├── usb_host_android.h │ │ ├── usb_host_audio_v1.h │ │ ├── usb_host_cdc.h │ │ ├── usb_host_cdc_interface.h │ │ ├── usb_host_hid.h │ │ ├── usb_host_hid_parser.h │ │ ├── usb_host_msd.h │ │ ├── usb_host_msd_scsi.h │ │ └── usb_struct_queue.h │ │ └── src │ │ ├── usb_device.c │ │ ├── usb_device_audio.c │ │ ├── usb_device_ccid.c │ │ ├── usb_device_cdc.c │ │ ├── usb_device_generic.c │ │ ├── usb_device_hid.c │ │ ├── usb_device_local.h │ │ ├── usb_device_msd.c │ │ ├── usb_device_msd_multi_sector.c │ │ ├── usb_device_phdc.c │ │ ├── usb_device_phdc_com_model.c │ │ ├── usb_hal_16bit.c │ │ ├── usb_hal_32bit.c │ │ ├── usb_hal_dspic33e.c │ │ ├── usb_hal_local.h │ │ ├── usb_hal_pic24.c │ │ ├── usb_hal_pic24e.c │ │ ├── usb_hal_pic24f.c │ │ ├── usb_host.c │ │ ├── usb_host_android.c │ │ ├── usb_host_android_local.h │ │ ├── usb_host_audio_v1.c │ │ ├── usb_host_cdc.c │ │ ├── usb_host_cdc_interface.c │ │ ├── usb_host_generic.c │ │ ├── usb_host_hid.c │ │ ├── usb_host_hid_parser.c │ │ ├── usb_host_local.h │ │ ├── usb_host_midi.c │ │ ├── usb_host_msd.c │ │ ├── usb_host_msd_scsi.c │ │ ├── usb_host_printer.c │ │ ├── usb_host_printer_esc_pos.c │ │ ├── usb_host_printer_pcl_5.c │ │ ├── usb_host_printer_postscript.c │ │ ├── usb_host_printer_primitives.c │ │ └── usb_pic18_local.h │ └── utilities │ └── usb_drivers │ └── mplab_comm │ ├── Linux │ ├── 32Bit │ │ ├── ReadMe_32Bit_Linux.txt │ │ ├── mchpdefport │ │ ├── mchplinusbdevice │ │ └── z010_mchp_tools.rules │ └── 64Bit │ │ ├── ReadMe_64Bit_Linux.txt │ │ ├── mchpdefport │ │ ├── mchplinusbdevice │ │ └── z010_mchp_tools.rules │ ├── MacOSX │ ├── OSX_10.5 │ │ ├── ReadMe_OSX_10.5.txt │ │ ├── libUSBAccessLink.dylib │ │ ├── libusb-1.0.0.dylib │ │ ├── mchpdefport │ │ └── mchpmacusbdevice │ └── OSX_10.6_And_Later │ │ ├── ReadMe_OSX_10.6.txt │ │ ├── libUSBAccessLink.dylib │ │ ├── libusb-1.0.0.dylib │ │ ├── mchpdefport │ │ └── mchpmacusbdevice │ └── Windows │ ├── MPLABCommWinUSB.inf │ ├── ZENA Adapter 2.4GHz MRF24J40.inf │ ├── amd64 │ ├── WUDFUpdate_01009.dll │ ├── WdfCoInstaller01009.dll │ └── winusbcoinstaller2.dll │ ├── i386 │ ├── WUDFUpdate_01009.dll │ ├── WdfCoInstaller01009.dll │ └── winusbcoinstaller2.dll │ ├── mplabcommwinusb.cat │ └── zena adapter 2.4ghz mrf24j40.cat ├── vga ├── term640 │ ├── BasicI2C.spin │ ├── Full-Duplex_COMEngine.spin │ ├── VGA_HiRes_Text.spin │ └── terminal.spin └── term720 │ ├── BasicI2C.spin │ ├── Full-Duplex_COMEngine.spin │ ├── core.con.system.spin │ ├── generic8x16-4font.spin │ ├── terminal.spin │ └── waitvid.80x30.c0df.driver.2048.spin └── zilog ├── lib.zip ├── patch_zds2_ez80_5.3.0.diff └── targets.zip /docs/HOWTO/blinky.txt: -------------------------------------------------------------------------------- 1 | Setting up a "blinky" circuit 2 | 3 | The "blinky.l" demonstration program in "/demo" uses Port A bit/pin 7 (PA7) as an output to drive 4 | an LED. To set up the circuit expected by blinky.l: 5 | 6 | 1) Using a female to male jumper wire, connect the GPIO PA7 header on the I/O expansion board to 7 | a breadboard vertical row, into which you have placed the positive (long) lead of an LED. 8 | 9 | 2) Place a 330 ohm resistor in the breadboard, one lead in the vertical row that is connected to 10 | the negative (short) lead of the LED, and the other end in a horizontal bus row, connected to 11 | ground. You may have to rearrange the wiring of ground to one of the controller boards, in order 12 | to use a horizontal bus row on the breadboard as a common ground for both the controller board and 13 | the LED circuit. 14 | 15 | 3) When the blinky.l program runs, as it raises PA7 high, 3.3 V out of PA7 will drive 10 mA through 16 | the LED and 330 ohm resistor in series to ground, lighting the LED. When PA7 is dropped by 17 | blinky.l to 0 V, currrent flow through the LED will cease, and the LED will turn off. 18 | -------------------------------------------------------------------------------- /docs/MakerLisp Language.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/MakerLisp Language.pdf -------------------------------------------------------------------------------- /docs/MakerLisp Machine.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/MakerLisp Machine.pdf -------------------------------------------------------------------------------- /docs/Presentation.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/Presentation.ppt -------------------------------------------------------------------------------- /docs/bom/cpu_bom.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/bom/cpu_bom.pdf -------------------------------------------------------------------------------- /docs/bom/ioexp_bom.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/bom/ioexp_bom.pdf -------------------------------------------------------------------------------- /docs/bom/usb_bom.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/bom/usb_bom.pdf -------------------------------------------------------------------------------- /docs/bom/vga_bom.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/bom/vga_bom.pdf -------------------------------------------------------------------------------- /docs/license/license.txt: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // TERMS OF USE: MIT License 3 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation 5 | // files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, 6 | // modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the 7 | // Software is furnished to do so, subject to the following conditions: 8 | // 9 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 10 | // Software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 13 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 14 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 15 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 16 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 17 | -------------------------------------------------------------------------------- /docs/manuals/mlmhwref.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/manuals/mlmhwref.pdf -------------------------------------------------------------------------------- /docs/schematic/cpu_sch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/schematic/cpu_sch.pdf -------------------------------------------------------------------------------- /docs/schematic/ioexp_sch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/schematic/ioexp_sch.pdf -------------------------------------------------------------------------------- /docs/schematic/usb_sch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/schematic/usb_sch.pdf -------------------------------------------------------------------------------- /docs/schematic/vga_sch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/docs/schematic/vga_sch.pdf -------------------------------------------------------------------------------- /makerlisp.udb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/makerlisp.udb -------------------------------------------------------------------------------- /src/cpm/ascii.h: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------- 2 | // Copyright (c) 2019, Christopher D. Farrar 3 | //---------------------------------------------------------------------------- 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //---------------------------------------------------------------------------- 7 | #ifndef ASCII_H 8 | #define ASCII_H 9 | //---------------------------------------------------------------------------- 10 | #define ASCII_SOH (0x01) 11 | #define ASCII_ETX (0x03) 12 | #define ASCII_EOT (0x04) 13 | #define ASCII_BELL (0x07) 14 | #define ASCII_BACKSPACE (0x08) 15 | #define ASCII_TAB (0x09) 16 | #define ASCII_LINEFEED (0x0A) 17 | #define ASCII_ENTER (0x0D) 18 | #define ASCII_SUB (0x1A) 19 | #define ASCII_ESCAPE (0x1B) 20 | #define ASCII_ETXCEL (0x18) 21 | #define ASCII_DELETE (0x7F) 22 | 23 | #define ASCII_COLEN (':') 24 | //---------------------------------------------------------------------------- 25 | #endif // ASCII_H 26 | //---------------------------------------------------------------------------- 27 | -------------------------------------------------------------------------------- /src/cpm/chario.c: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------ 2 | // Copyright (c) 2018, Christopher D. Farrar 3 | //------------------------------------------------------------------------ 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //---------------------------------------------------------------------------- 7 | #include 8 | #include 9 | //------------------------------------------------------------------------ 10 | #include "chario.h" 11 | //------------------------------------------------------------------------ 12 | UINT8 consoleCharInReady( void ) 13 | { 14 | return ( kbhit() ) ? 0xFF : 0x00; 15 | } 16 | //------------------------------------------------------------------------ 17 | char consoleCharIn( void ) 18 | { 19 | char c; 20 | unsigned n = 1; 21 | do 22 | { 23 | read_UART0( &c, &n ); 24 | } 25 | while ( 0 == n ); 26 | return c; 27 | } 28 | //------------------------------------------------------------------------ 29 | UINT8 consoleCharOutReady( void ) 30 | { 31 | return 0xFF; 32 | } 33 | //------------------------------------------------------------------------ 34 | void consoleCharOut( char c ) 35 | { 36 | UCHAR result; 37 | do 38 | { 39 | result = write_UART0( &c, 1 ); 40 | } 41 | while ( result != UART_ERR_NONE ); 42 | } 43 | //------------------------------------------------------------------------ 44 | -------------------------------------------------------------------------------- /src/cpm/chario.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------ 2 | // Copyright (c) 2018, Christopher D. Farrar 3 | //------------------------------------------------------------------------ 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //---------------------------------------------------------------------------- 7 | #ifndef CHARIO_H 8 | #define CHARIO_H 9 | //------------------------------------------------------------------------ 10 | #include 11 | #include 12 | //------------------------------------------------------------------------ 13 | #define GETC( c, n ) read_UART0( &c, &n ) 14 | #define PUTC( c ) write_UART0( &c, 1 ) 15 | #define PRINT( s ) write_UART0( s, strlen(s) ) 16 | //------------------------------------------------------------------------ 17 | UINT8 consoleCharInReady( void ); 18 | char consoleCharIn( void ); 19 | UINT8 consoleCharOutReady( void ); 20 | void consoleCharOut( char c ); 21 | //------------------------------------------------------------------------ 22 | #endif // CHARIO_H 23 | //------------------------------------------------------------------------ 24 | -------------------------------------------------------------------------------- /src/cpm/cpmchario.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------ 2 | // Copyright (c) 2018, Christopher D. Farrar 3 | //------------------------------------------------------------------------ 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //---------------------------------------------------------------------------- 7 | #ifndef CPMCHARIO_H 8 | #define CPMCHARIO_H 9 | //------------------------------------------------------------------------ 10 | #include 11 | //------------------------------------------------------------------------ 12 | #define GETC( c, n ) read_UART0( &c, &n ) 13 | #define PUTC( c ) write_UART0( &c, 1 ) 14 | #define PRINT( s ) write_UART0( s, strlen(s) ) 15 | //------------------------------------------------------------------------ 16 | void cpmConsoleCharInReady( void ); 17 | void cpmConsoleCharIn( void ); 18 | void cpmConsoleCharOutReady( void ); 19 | void cpmConsoleCharOut( void ); 20 | void cpmConsoleStringOut( void ); 21 | void cpmListCharOutReady( void ); 22 | void cpmListCharOut( void ); 23 | void cpmReaderCharInReady( void ); 24 | void cpmReaderCharIn( void ); 25 | void cpmPunchCharOutReady( void ); 26 | void cpmPunchCharOut( void ); 27 | //------------------------------------------------------------------------ 28 | #endif // CPMCHARIO_H 29 | //------------------------------------------------------------------------ 30 | -------------------------------------------------------------------------------- /src/cpm/cpmdiskio.h: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------- 2 | // Copyright (c) 2019, Christopher D. Farrar 3 | //---------------------------------------------------------------------------- 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //---------------------------------------------------------------------------- 7 | #ifndef CPMDISKIO_H 8 | #define CPMDISKIO_H 9 | //---------------------------------------------------------------------------- 10 | #define LOGICAL_SECTOR_SIZE (128) 11 | //---------------------------------------------------------------------------- 12 | void cpmSelectDisk( void ); 13 | void cpmHomeHead( void ); 14 | void cpmSetTrack( void ); 15 | void cpmSetSector( void ); 16 | void cpmSetDma( void ); 17 | void cpmReadSector( void ); 18 | void cpmWriteSector( void ); 19 | void cpmTranslateSector( void ); 20 | //---------------------------------------------------------------------------- 21 | #endif // CPMDISKIO_H 22 | //---------------------------------------------------------------------------- 23 | -------------------------------------------------------------------------------- /src/cpm/cpmdispatch.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------ 2 | // Copyright (c) 2019, Christopher D. Farrar 3 | //------------------------------------------------------------------------ 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //---------------------------------------------------------------------------- 7 | #ifndef CPMDISPATCH_H 8 | #define CPMDISPATCH_H 9 | //---------------------------------------------------------------------------- 10 | void adl_biosDispatch( void ); 11 | //---------------------------------------------------------------------------- 12 | #endif // CPMDISPATCH_H 13 | //---------------------------------------------------------------------------- 14 | -------------------------------------------------------------------------------- /src/cpm/cpmload.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------ 2 | // Copyright (c) 2019, Christopher D. Farrar 3 | //------------------------------------------------------------------------ 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //------------------------------------------------------------------------ 7 | #ifndef CPMLOAD_H 8 | #define CPMLOAD_H 9 | //------------------------------------------------------------------------ 10 | #define CPM_RAM_SIZE ( 65536 ) /* can be less than 64k but why? */ 11 | #define CPM_RAM_ALIGNMENT ( 65536 ) /* must always be 64k */ 12 | //------------------------------------------------------------------------ 13 | #define MEMSIZE ( 62 ) /* give extra room for disk tables and buffers */ 14 | //------------------------------------------------------------------------ 15 | #define CCP ( ( MEMSIZE - 7 ) * 1024 ) 16 | #define BDOS ( CCP + 0x800 ) 17 | #define BIOS ( CCP + 0x1600 ) 18 | //------------------------------------------------------------------------ 19 | void cpmLoadCcpBdos( void ); 20 | void loadCcpBdosBios( void ); 21 | void loadEntryAndStart( void ); 22 | void startCpm( void ); 23 | //------------------------------------------------------------------------ 24 | #endif // CPMLOAD_H 25 | //------------------------------------------------------------------------ 26 | -------------------------------------------------------------------------------- /src/cpm/cpmregisters.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------ 2 | // Copyright (c) 2019, Christopher D. Farrar 3 | //------------------------------------------------------------------------ 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //---------------------------------------------------------------------------- 7 | #ifndef CPMREGISTERS_H 8 | #define CPMREGISTERS_H 9 | //---------------------------------------------------------------------------- 10 | // registers for communication with cpm 11 | //---------------------------------------------------------------------------- 12 | #include 13 | //---------------------------------------------------------------------------- 14 | extern UINT8 mbregister; 15 | extern UINT24 afregister; 16 | extern UINT24 bcregister; 17 | extern UINT24 deregister; 18 | extern UINT24 hlregister; 19 | //---------------------------------------------------------------------------- 20 | extern UINT8 ivregister; 21 | //---------------------------------------------------------------------------- 22 | #endif // CPMREGISTERS_H 23 | //---------------------------------------------------------------------------- 24 | -------------------------------------------------------------------------------- /src/cpm/cpmtable.h: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------- 2 | // Copyright (c) 2019, Christopher D. Farrar 3 | //---------------------------------------------------------------------------- 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //---------------------------------------------------------------------------- 7 | #ifndef TABLE_H 8 | #define TABLE_H 9 | //---------------------------------------------------------------------------- 10 | #include 11 | //---------------------------------------------------------------------------- 12 | UINT16 getDphP( UINT8 disk ); 13 | void cpmSetRamBase( void ); 14 | //---------------------------------------------------------------------------- 15 | #endif // TABLE_H 16 | //---------------------------------------------------------------------------- 17 | -------------------------------------------------------------------------------- /src/cpm/disks.h: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------- 2 | // Copyright (c) 2019, Christopher D. Farrar 3 | //---------------------------------------------------------------------------- 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //---------------------------------------------------------------------------- 7 | #ifndef DISKS_H 8 | #define DISKS_H 9 | //---------------------------------------------------------------------------- 10 | #include 11 | //---------------------------------------------------------------------------- 12 | UINT16 selectDisk( UINT8 newLog, UINT8 disk ); 13 | void homeHead( void ); 14 | void setTrack( UINT16 track ); 15 | void setSector( UINT16 sector ); 16 | void setDma( unsigned char *dma ); 17 | UINT8 readSector( void ); 18 | UINT8 writeSector( UINT8 writeType ); 19 | UINT16 translateSector( UINT16 logical ); 20 | void setRamBase( unsigned char *ramBase ); 21 | //---------------------------------------------------------------------------- 22 | void initCpmDiskio( void ); 23 | //---------------------------------------------------------------------------- 24 | #endif // DISKS_H 25 | //---------------------------------------------------------------------------- 26 | -------------------------------------------------------------------------------- /src/cpm/eZ80-CPM.asm: -------------------------------------------------------------------------------- 1 | ; CP/M v2.2 Copyright 1979 (c) by Digital Research 2 | ; Ported to the eZ80F91 platform by 3 | ; Jean-Michel Howland 4 | ; Christopher D. Farrar 5 | 6 | CPU = EZ80F91 7 | 8 | .ASSUME ADL=0 9 | 10 | INCLUDE "eZ80-CPM-MDEF.inc" ; CP/M memory defines. 11 | 12 | ORG ccp ; start addr of cpm binary blob 13 | 14 | ; Start of CP/M code. 15 | 16 | INCLUDE "eZ80-CPM-CCP.inc" ; CP/M Console Command Processor code. 17 | INCLUDE "eZ80-CPM-BDOS.inc" ; CP/M Basic Disk Operating System code. 18 | INCLUDE "eZ80-CPM-BIOS.inc" ; CP/M Basic Input/Output System code. 19 | 20 | ; End of CP/M code. 21 | 22 | END 23 | -------------------------------------------------------------------------------- /src/cpm/isrwrap.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------ 2 | // Copyright (c) 2019, Christopher D. Farrar 3 | //------------------------------------------------------------------------ 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //---------------------------------------------------------------------------- 7 | #ifndef ISRWRAP_H 8 | #define ISRWRAP_H 9 | //---------------------------------------------------------------------------- 10 | void isruart0( void ); 11 | void isruart1( void ); 12 | //---------------------------------------------------------------------------- 13 | #endif // ISRWRAP_H 14 | //---------------------------------------------------------------------------- 15 | -------------------------------------------------------------------------------- /src/cpm/main.c: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------ 2 | // Copyright (c) 2019, Christopher D. Farrar 3 | //------------------------------------------------------------------------ 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //------------------------------------------------------------------------ 7 | #include 8 | #include 9 | //---------------------------------------------------------------------------- 10 | #include "cpmload.h" 11 | #include "mlmhw.h" 12 | //------------------------------------------------------------------------ 13 | 14 | /* Timeout on VGA ready */ 15 | #define WAIT4VGA 2000000 16 | 17 | int main() 18 | { 19 | int i; 20 | 21 | /* Initialize MakerLisp CPU */ 22 | init_mlmhw(); 23 | 24 | /* Expansion board attached ? */ 25 | i = 0; 26 | if (mlmeb()) { 27 | 28 | /* Wait for VGA ready */ 29 | while (i < WAIT4VGA) { 30 | if (PB_DR & (1 << 1)) { 31 | break; 32 | } 33 | ++i; 34 | } 35 | if (!(i < WAIT4VGA)) { 36 | i = 0; 37 | } 38 | } 39 | 40 | /* If not VGA cold boot */ 41 | if (!i) { 42 | 43 | /* Set graphic attributes, beep */ 44 | printf("\x1b[0m\a"); 45 | } 46 | 47 | /* Set non-newline mode */ 48 | printf("\x1b[20l"); 49 | 50 | /* Start CP/M */ 51 | for ( ;; ) 52 | { 53 | startCpm(); 54 | } 55 | } 56 | //------------------------------------------------------------------------ 57 | -------------------------------------------------------------------------------- /src/cpm/middle.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------ 2 | // Copyright (c) 2019, Christopher D. Farrar 3 | //------------------------------------------------------------------------ 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //------------------------------------------------------------------------ 7 | #ifndef MIDDLE_H 8 | #define MIDDLE_H 9 | //------------------------------------------------------------------------ 10 | void adl_startCpm( void ); 11 | void adl_biosEntry( void ); 12 | //------------------------------------------------------------------------ 13 | #endif // MIDDLE_H 14 | //------------------------------------------------------------------------ 15 | -------------------------------------------------------------------------------- /src/cpm/stringio.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------ 2 | // Copyright (c) 2018, Christopher D. Farrar 3 | //------------------------------------------------------------------------ 4 | // I here grant permission to any and all to copy and use this software for 5 | // any purpose as long as my copyright message is retained. 6 | //---------------------------------------------------------------------------- 7 | #ifndef STRINGIO_H 8 | #define STRINGIO_H 9 | //------------------------------------------------------------------------ 10 | void consoleStringOut( char *stringP ); 11 | unsigned consoleStringIn( char *bufferP, unsigned size ); 12 | //------------------------------------------------------------------------ 13 | #endif // STRINGIO_H 14 | //------------------------------------------------------------------------ 15 | -------------------------------------------------------------------------------- /src/fatfs/documents/doc/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_error 10 | 11 | 12 | 13 | 14 |
15 |

f_error

16 |

The f_error tests for an error on a file.

17 |
18 | int f_error (
19 |   FIL* fp   /* [IN] File object */
20 | );
21 | 
22 |
23 | 24 | 25 |
26 |

Parameters

27 |
28 |
fp
29 |
Pointer to the open file object structure.
30 |
31 |
32 | 33 | 34 |
35 |

Return Values

36 |

Returns a non-zero value if a hard error has occured; otherwise it returns a zero.

37 |
38 | 39 | 40 |
41 |

Description

42 |

In this revision, this function is implemented as a macro. It does not have any validation and mutual exclusion.

43 |
44 | #define f_error(fp) ((fp)->err)
45 | 
46 |
47 | 48 | 49 |
50 |

QuickInfo

51 |

Always available.

52 |
53 | 54 | 55 |
56 |

See Also

57 |

f_open, FIL

58 |
59 | 60 |

Return

61 | 62 | 63 | -------------------------------------------------------------------------------- /src/fatfs/documents/doc/size.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_size 10 | 11 | 12 | 13 | 14 |
15 |

f_size

16 |

The f_size function gets the size of a file.

17 |
18 | FSIZE_t f_size (
19 |   FIL* fp   /* [IN] File object */
20 | );
21 | 
22 |
23 | 24 | 25 |
26 |

Parameters

27 |
28 |
fp
29 |
Pointer to the open file object structure.
30 |
31 |
32 | 33 | 34 |
35 |

Return Values

36 |

Returns the size of the file in unit of byte.

37 |
38 | 39 | 40 |
41 |

Description

42 |

In this revision, the f_size function is implemented as a macro. It does not have any validation and mutual exclusion.

43 |
44 | #define f_size(fp) ((fp)->obj.objsize)
45 | 
46 |
47 | 48 | 49 |
50 |

QuickInfo

51 |

Always available.

52 |
53 | 54 | 55 |
56 |

See Also

57 |

f_open, f_lseek, FIL

58 |
59 | 60 |

Return

61 | 62 | 63 | -------------------------------------------------------------------------------- /src/fatfs/documents/doc/tell.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FatFs - f_tell 10 | 11 | 12 | 13 | 14 |
15 |

f_tell

16 |

The f_tell function gets the current read/write pointer of a file.

17 |
18 | FSIZE_t f_tell (
19 |   FIL* fp   /* [IN] File object */
20 | );
21 | 
22 |
23 | 24 | 25 |
26 |

Parameters

27 |
28 |
fp
29 |
Pointer to the open file object structure.
30 |
31 |
32 | 33 | 34 |
35 |

Return Values

36 |

Returns current read/write pointer of the file.

37 |
38 | 39 | 40 |
41 |

Description

42 |

In this revision, the f_tell function is implemented as a macro. It does not have any validation and mutual exclusion.

43 |
44 | #define f_tell(fp) ((fp)->fptr)
45 | 
46 |
47 | 48 | 49 |
50 |

QuickInfo

51 |

Always available.

52 |
53 | 54 | 55 |
56 |

See Also

57 |

f_open, f_lseek, FIL

58 |
59 | 60 |

Return

61 | 62 | 63 | -------------------------------------------------------------------------------- /src/fatfs/documents/res/app1.c: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------/ 2 | / Open or create a file in append mode 3 | / (This function was sperseded by FA_OPEN_APPEND flag at FatFs R0.12a) 4 | /------------------------------------------------------------*/ 5 | 6 | FRESULT open_append ( 7 | FIL* fp, /* [OUT] File object to create */ 8 | const char* path /* [IN] File name to be opened */ 9 | ) 10 | { 11 | FRESULT fr; 12 | 13 | /* Opens an existing file. If not exist, creates a new file. */ 14 | fr = f_open(fp, path, FA_WRITE | FA_OPEN_ALWAYS); 15 | if (fr == FR_OK) { 16 | /* Seek to end of the file to append data */ 17 | fr = f_lseek(fp, f_size(fp)); 18 | if (fr != FR_OK) 19 | f_close(fp); 20 | } 21 | return fr; 22 | } 23 | 24 | 25 | int main (void) 26 | { 27 | FRESULT fr; 28 | FATFS fs; 29 | FIL fil; 30 | 31 | /* Open or create a log file and ready to append */ 32 | f_mount(&fs, "", 0); 33 | fr = open_append(&fil, "logfile.txt"); 34 | if (fr != FR_OK) return 1; 35 | 36 | /* Append a line */ 37 | f_printf(&fil, "%02u/%02u/%u, %2u:%02u\n", Mday, Mon, Year, Hour, Min); 38 | 39 | /* Close the file */ 40 | f_close(&fil); 41 | 42 | return 0; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /src/fatfs/documents/res/app2.c: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------/ 2 | / Remove all contents of a directory 3 | / This function works regardless of FF_FS_RPATH. 4 | /------------------------------------------------------------*/ 5 | 6 | 7 | FILINFO fno; 8 | 9 | FRESULT empty_directory ( 10 | char* path /* Working buffer filled with start directory */ 11 | ) 12 | { 13 | UINT i, j; 14 | FRESULT fr; 15 | DIR dir; 16 | 17 | fr = f_opendir(&dir, path); 18 | if (fr == FR_OK) { 19 | for (i = 0; path[i]; i++) ; 20 | path[i++] = '/'; 21 | for (;;) { 22 | fr = f_readdir(&dir, &fno); 23 | if (fr != FR_OK || !fno.fname[0]) break; 24 | if (_FS_RPATH && fno.fname[0] == '.') continue; 25 | j = 0; 26 | do 27 | path[i+j] = fno.fname[j]; 28 | while (fno.fname[j++]); 29 | if (fno.fattrib & AM_DIR) { 30 | fr = empty_directory(path); 31 | if (fr != FR_OK) break; 32 | } 33 | fr = f_unlink(path); 34 | if (fr != FR_OK) break; 35 | } 36 | path[--i] = '\0'; 37 | closedir(&dir); 38 | } 39 | 40 | return fr; 41 | } 42 | 43 | 44 | 45 | int main (void) 46 | { 47 | FRESULT fr; 48 | FATFS fs; 49 | char buff[256]; /* Working buffer */ 50 | 51 | 52 | 53 | f_mount(&fs, "", 0); 54 | 55 | strcpy(buff, "/"); /* Directory to be emptied */ 56 | fr = empty_directory(buff); 57 | 58 | if (fr) { 59 | printf("Function failed. (%u)\n", fr); 60 | return fr; 61 | } else { 62 | printf("All contents in the %s are successfully removed.\n", buff); 63 | return 0; 64 | } 65 | } 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/fatfs/documents/res/f1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/f1.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/f2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/f2.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/f3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/f3.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/f4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/f4.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/f5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/f5.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/f6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/f6.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/f7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/f7.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/funcs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/funcs.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/layers.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/layers1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/layers1.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/layers2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/layers2.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/layers3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/layers3.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/mkfatimg.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/mkfatimg.zip -------------------------------------------------------------------------------- /src/fatfs/documents/res/mkfs.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/mkfs.xls -------------------------------------------------------------------------------- /src/fatfs/documents/res/modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/modules.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/rwtest1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/rwtest1.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/rwtest2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/rwtest2.png -------------------------------------------------------------------------------- /src/fatfs/documents/res/rwtest3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/fatfs/documents/res/rwtest3.png -------------------------------------------------------------------------------- /src/fatfs/source/00readme.txt: -------------------------------------------------------------------------------- 1 | FatFs Module Source Files R0.13b 2 | 3 | 4 | FILES 5 | 6 | 00readme.txt This file. 7 | 00history.txt Revision history. 8 | ff.c FatFs module. 9 | ffconf.h Configuration file of FatFs module. 10 | ff.h Common include file for FatFs and application module. 11 | diskio.h Common include file for FatFs and disk I/O module. 12 | diskio.c An example of glue function to attach existing disk I/O module to FatFs. 13 | integer.h Integer type definitions for FatFs. 14 | ffunicode.c Optional Unicode utility functions. 15 | ffsystem.c An example of optional O/S related functions. 16 | 17 | 18 | Low level disk I/O module is not included in this archive because the FatFs 19 | module is only a generic file system layer and it does not depend on any specific 20 | storage device. You need to provide a low level disk I/O module written to 21 | control the storage device that attached to the target system. 22 | 23 | -------------------------------------------------------------------------------- /src/fatfs/source/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _FF_INTEGER 6 | #define _FF_INTEGER 7 | #include 8 | typedef WORD WCHAR; 9 | #endif 10 | -------------------------------------------------------------------------------- /src/libc/stdio/stdio.h: -------------------------------------------------------------------------------- 1 | /* Interface to stdio that integrates ZSL and FATFS */ 2 | #ifndef _STDIO_H_ 3 | #define _STDIO_H_ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | /* Original Zilog code */ 11 | int printf(char * format, ...); 12 | int scanf(char * format, ...); 13 | int sprintf(char * s,char * format, ...); 14 | int sscanf(char * s,char * format, ...); 15 | int vprintf(char * format,va_list arg); 16 | int vsprintf(char * s,char * format,va_list arg); 17 | 18 | /* New code */ 19 | #define _IOFBF 0 20 | #define _IOLBF 1 21 | #define _IONBF 2 22 | 23 | typedef struct file_struct { 24 | char ungetbuf; 25 | int ungetcnt; 26 | FIL *filp; 27 | } FILE; 28 | 29 | extern FILE *stdin, *stdout, *stderr; 30 | 31 | extern int fclose(FILE *fp); 32 | extern int feof(FILE *fp); 33 | extern int fflush(FILE *fp); 34 | extern int fgetc(FILE *fp); 35 | extern char *fgets(char *buf, int n, FILE *fp); 36 | extern FILE *fopen(char *path, char *mode); 37 | extern int fputc(char c, FILE *fp); 38 | extern int fputs(char *s, FILE *fp); 39 | extern int fseek(FILE *fp, long offset, int whence); 40 | extern int remove(char *path); 41 | extern int rewind(FILE *fp); 42 | extern int setvbuf(FILE *fp, char *buf, int mode, size_t size); 43 | extern int ungetc(int c, FILE *fp); 44 | 45 | #define getc fgetc 46 | #define getchar() getc(stdin) 47 | #define gets(b) fgets(b, INT_MAX, stdin) 48 | #define putc fputc 49 | #define putchar(c) putc(c, stdout) 50 | #define puts(s) (!(fputs(s, stdout) < 0) ? putchar('\n') : EOF) 51 | 52 | #endif /* _STDIO_H_ */ 53 | -------------------------------------------------------------------------------- /src/lisp/linux/Makefile: -------------------------------------------------------------------------------- 1 | # Make MakerLisp 2 | 3 | # Tools and rules 4 | OPTIMIZE= -O3 5 | CFLAGS= -Wall -I$(PLATFORM) 6 | 7 | .SUFFIXES: 8 | .SUFFIXES: .c .h 9 | 10 | # Components 11 | LISP= lisp 12 | SRC= .. 13 | LISPSRC= $(SRC)/lisp.c 14 | 15 | PLATFORM= . 16 | OSSRC= $(PLATFORM)/platform.c 17 | OSHDR= $(PLATFORM)/platform.h 18 | 19 | HEADERS= $(OSHDR) 20 | SOURCES= $(LISPSRC) $(OSSRC) 21 | MATHLIB= -lm 22 | 23 | # Targets 24 | all: $(LISP) 25 | 26 | $(LISP): $(SOURCES) $(HEADERS) 27 | $(CC) -o $@ $(CFLAGS) $(OPTIMIZE) $(SOURCES) $(MATHLIB) 28 | 29 | reference: $(LISP) 30 | @./runtests.sh reference 31 | 32 | test: $(LISP) 33 | @./runtests.sh test 34 | 35 | clean: 36 | rm -f $(LISP) 37 | 38 | clobber: clean 39 | nclb clean --force > /dev/null 40 | 41 | # Dependencies 42 | -------------------------------------------------------------------------------- /src/lisp/linux/lisp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -n "$1" ]; then 3 | cat $1 | lisp 4 | else 5 | lisp 6 | fi 7 | -------------------------------------------------------------------------------- /src/lisp/linux/runtests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Run tests 4 | cd tests 5 | PATH=..:$PATH 6 | for f in `ls *.l` ; do 7 | echo $f 8 | if [ -n "$1" ]; then 9 | cat $f | lisp > $f.$1 10 | else 11 | cat $f | lisp 12 | fi 13 | if [ -n "$1" -a "$1" != "reference" ]; then 14 | diff $f.reference $f.$1 15 | rm -f $f.$1 16 | fi 17 | done 18 | -------------------------------------------------------------------------------- /src/lisp/linux/tests/bubbleint.l: -------------------------------------------------------------------------------- 1 | #!lisp.sh 2 | (verbose 99) 3 | 4 | ; Bubble sort of integers 5 | (define bubble 6 | (lambda (unsorted) 7 | 8 | ; Check for list of integers 9 | (define listint 10 | (lambda (x) 11 | (if (null x) 12 | 't 13 | (and (pairp x) (integerp (car x)) (listint (cdr x)))))) 14 | 15 | (define bubble1 16 | (lambda (k) 17 | 18 | (if (not (listint unsorted)) 19 | (k '"bubble expects list of integers")) 20 | 21 | ; Now bubble sort 22 | (let ((change 't) (result unsorted)) 23 | 24 | ; Return a list, bubbled once on each adjacent pair 25 | (define sort1 26 | (lambda (x) 27 | (if (or (null x) (null (cdr x))) 28 | x 29 | (if (> (car x) (car (cdr x))) 30 | (progn 31 | (setq change 't) 32 | (cons (car (cdr x)) (sort1 (cons (car x) (cdr (cdr x)))))) 33 | (cons (car x) (sort1 (cdr x))))))) 34 | 35 | ; Bubble until no change 36 | (while change 37 | (setq change '()) 38 | (setq result (sort1 result))) 39 | 40 | result))) 41 | 42 | (call/cc bubble1))) 43 | 44 | ; Now test it 45 | (bubble 0) 46 | (bubble '()) 47 | (bubble '(9 8 7 6 5 4 3 2 1 a)) 48 | (bubble '(0xa 9 8 7 6 5 4 3 2 1)) 49 | -------------------------------------------------------------------------------- /src/lisp/linux/tests/coroutine.l: -------------------------------------------------------------------------------- 1 | #!lisp.sh 2 | 3 | ; Test coroutines using continuations 4 | (include ') 5 | 6 | (verbose 99) 7 | 8 | (define resume (macro (t) `(setq ,t (call/cc ,t)))) 9 | 10 | (define task1 11 | (lambda (k) 12 | (let ((t2 task2)) 13 | (print '"Part A\n") 14 | (print '"task1 starting task2\n") 15 | (resume t2) 16 | (print '"Part B\n") 17 | (print '"Part C\n") 18 | (print '"task1 resuming task2\n") 19 | (resume t2) 20 | (print '"task1 finishing\n") 21 | (k 0)))) 22 | 23 | (define task2 24 | (lambda (k) 25 | (let ((t1 k)) 26 | (print '"Part D\n") 27 | (print '"Part E\n") 28 | (print '"task2 resuming task1\n") 29 | (resume t1) 30 | (print '"Part F\n") 31 | (print '"task2 finishing, resuming task1\n") 32 | (resume t1)))) 33 | 34 | (print '"Starting task1\n") 35 | (call/cc task1) 36 | -------------------------------------------------------------------------------- /src/lisp/linux/tests/fact.l: -------------------------------------------------------------------------------- 1 | #!lisp.sh 2 | 3 | ; Recursive looping factorial test 4 | 5 | ; Factorial 6 | (define fact 7 | (lambda (x) 8 | (if (zerop x) 1 (* x (fact (- x 1)))))) 9 | 10 | ; Loop a million times 11 | (define loopfact 12 | (lambda (i) 13 | (if (< i 1000000) 14 | (progn 15 | (fact 42) 16 | (loopfact (+ i 1))) 17 | i))) 18 | 19 | (loopfact 0) 20 | 21 | ; Look at the code 22 | fact 23 | -------------------------------------------------------------------------------- /src/lisp/linux/tests/fact.l.reference: -------------------------------------------------------------------------------- 1 | MakerLisp Version 1.3 2 | #!lisp.sh 3 | 4 | ; Recursive looping factorial test 5 | 6 | ; Factorial 7 | (define fact 8 | (lambda (x) 9 | (if (zerop x) 1 (* x (fact (- x 1)))))) 10 | (#Address (x) (LOADC #Address (if (zerop x) 1 (* x (fact (- x 1)))))) 11 | 12 | ; Loop a million times 13 | (define loopfact 14 | (lambda (i) 15 | (if (< i 1000000) 16 | (progn 17 | (fact 42) 18 | (loopfact (+ i 1))) 19 | i))) 20 | (#Address (i) (LOADC #Address (if (< i 1000000) (progn (fact 42) (loopfact (+ i 1))) i))) 21 | 22 | (loopfact 0) 23 | 1000000 24 | 25 | ; Look at the code 26 | fact 27 | (#Address (x) (GET00 ZEROP SELECT (QUOTE 1) (EVALC (QUOTE 1 GET00 SUB GETB #Address APPLY) GET00 MUL))) 28 | Bytes: 32992/36872, Symbols: 94, Hits: 709/1012, Collections: 25779 29 | -------------------------------------------------------------------------------- /src/lisp/linux/tests/reader.l: -------------------------------------------------------------------------------- 1 | #!lisp.sh 2 | ;Comment 3 | ;Comment 4 | ;Comment 5 | 'Symbol 6 | 'Symbol 7 | 'Symbol 8 | ;'Symbol 9 | ; A comment 10 | ;'"Not a comment" 11 | ;'"Not a comment" 12 | \;; Also not a comment 13 | \; But this is 14 | '\97; Decimal character constant 15 | '\97"Now it's a symbol" 16 | '\097; Bad octal character constant 17 | '\065; Good octal character constant 18 | '\x35; Hex character constant 19 | '\x35z; Bad hex character constant 20 | '"" ; comment after expression 21 | '( ; comment in expression 22 | ()) 23 | -------------------------------------------------------------------------------- /src/lisp/linux/tests/reader.l.reference: -------------------------------------------------------------------------------- 1 | MakerLisp Version 1.3 2 | #!lisp.sh 3 | ;Comment 4 | ;Comment^? 5 | ;Comment^H 6 | 'Symbol 7 | Symbol 8 | 'Symbol^? 9 | Symbo 10 | 'Symbol^H 11 | Symbo 12 | ;^?'Symbol 13 | Symbol 14 | ; A comment 15 | ;^?'"Not a comment" 16 | Not a comment 17 | ;^H'"Not a comment" 18 | Not a comment 19 | \;; Also not a comment 20 | ? Unbound variable: ";" 21 | \^?; But this is 22 | '\97; Decimal character constant 23 | a 24 | '\97^?^?^?"Now it's a symbol" 25 | Now it's a symbol 26 | '\097; Bad octal character constant 27 | ? Improper character constant 28 | '\065; Good octal character constant 29 | 5 30 | '\x35; Hex character constant 31 | 5 32 | '\x35z; Bad hex character constant 33 | 5z 34 | '"" 35 | ; comment after expression 36 | '( ; comment in expression 37 | ()) 38 | (()) 39 | Bytes: 19488/21664, Symbols: 72, Hits: 350/582, Collections: 126 40 | -------------------------------------------------------------------------------- /src/lisp/linux/tests/tak.l: -------------------------------------------------------------------------------- 1 | #!lisp.sh 2 | 3 | (define tak 4 | (lambda (x y z) 5 | (if (< y x) 6 | (tak (tak (- x 1) y z) 7 | (tak (- y 1) z x) 8 | (tak (- z 1) x y) 9 | ) 10 | z))) 11 | 12 | (define looptak 13 | (lambda (n) 14 | (if (zerop n) 15 | n 16 | (progn 17 | (tak 18 12 6) 18 | (looptak (- n 1)))))) 19 | 20 | (looptak 1000) 21 | -------------------------------------------------------------------------------- /src/lisp/linux/tests/tak.l.reference: -------------------------------------------------------------------------------- 1 | MakerLisp Version 1.3 2 | #!lisp.sh 3 | 4 | (define tak 5 | (lambda (x y z) 6 | (if (< y x) 7 | (tak (tak (- x 1) y z) 8 | (tak (- y 1) z x) 9 | (tak (- z 1) x y) 10 | ) 11 | z))) 12 | (#Address (x y z) (LOADC #Address (if (< y x) (tak (tak (- x 1) y z) (tak (- y 1) z x) (tak (- z 1) x y)) z))) 13 | 14 | (define looptak 15 | (lambda (n) 16 | (if (zerop n) 17 | n 18 | (progn 19 | (tak 18 12 6) 20 | (looptak (- n 1)))))) 21 | (#Address (n) (LOADC #Address (if (zerop n) n (progn (tak 18 12 6) (looptak (- n 1)))))) 22 | 23 | (looptak 1000) 24 | 0 25 | Bytes: 32064/37448, Symbols: 94, Hits: 659/951, Collections: 43670 26 | -------------------------------------------------------------------------------- /src/lisp/linux/tests/tmapcar.l: -------------------------------------------------------------------------------- 1 | ; Test mapcar and other appropriately-aggressive JIT situations 2 | (define foo (lambda (f x) (f x x))) 3 | (foo + 1) 4 | (foo - 1) 5 | (foo cats 'a) 6 | foo 7 | 8 | (mapcar car '((a 1) (b 2) (c 3))) 9 | (mapcar cdr '((a 1) (b 2) (c 3))) 10 | (mapcar cadr '((a 1) (b 2) (c 3))) 11 | mapcar 12 | 13 | (define reduce 14 | (lambda (function initial-value lst) 15 | (if (null lst) 16 | initial-value 17 | (reduce function 18 | (apply function (list initial-value (car lst))) 19 | (cdr lst))))) 20 | 21 | (reduce + 0 '(1 2 3 4 5)) 22 | (reduce + 999 '(1 2 3 4)) 23 | 24 | reduce 25 | -------------------------------------------------------------------------------- /src/lisp/linux/tests/tmapcar.l.reference: -------------------------------------------------------------------------------- 1 | MakerLisp Version 1.3 2 | ; Test mapcar and other appropriately-aggressive JIT situations 3 | (define foo (lambda (f x) (f x x))) 4 | (#Address (f x) (LOADC #Address (f x x))) 5 | (foo + 1) 6 | 2 7 | (foo - 1) 8 | 0 9 | (foo cats 'a) 10 | aa 11 | foo 12 | (#Address (f x) (LOADC #Address (f x x))) 13 | 14 | (mapcar car '((a 1) (b 2) (c 3))) 15 | (a b c) 16 | (mapcar cdr '((a 1) (b 2) (c 3))) 17 | ((1) (2) (3)) 18 | (mapcar cadr '((a 1) (b 2) (c 3))) 19 | (1 2 3) 20 | mapcar 21 | (#Address (f l) (GET00 NOT SELECT (QUOTE ()) (EVALC (GET00 CDR GET10 GETB #Address APPLY) EVALC (LOADC #Address (f (car l))) CONS))) 22 | 23 | (define reduce 24 | (lambda (function initial-value lst) 25 | (if (null lst) 26 | initial-value 27 | (reduce function 28 | (apply function (list initial-value (car lst))) 29 | (cdr lst))))) 30 | (#Address (function initial-value lst) (LOADC #Address (if (null lst) initial-value (reduce function (apply function (list initial-value (car lst))) (cdr lst))))) 31 | 32 | (reduce + 0 '(1 2 3 4 5)) 33 | 15 34 | (reduce + 999 '(1 2 3 4)) 35 | 1009 36 | 37 | reduce 38 | (#Address (function initial-value lst) (GET00 NOT SELECT (GET10) (GET00 CDR EVALC (EVALC (GET00 CAR GET10 LIST) GET20 QUOTE (#Address (f args) (EVALC (GET00 GETD _quoteargs 1 APPLY) QUOTE f CONS EVAL)) APPLY) GET20 GETB #Address APPLY))) 39 | Bytes: 32784/34240, Symbols: 95, Hits: 754/1096, Collections: 145 40 | -------------------------------------------------------------------------------- /src/mlmhw/mlmhw.h: -------------------------------------------------------------------------------- 1 | /* MakerLisp Machine low-level hardware support */ 2 | #ifndef _MLMHW_H_ 3 | #define _MLMHW_H_ 4 | 5 | #include 6 | 7 | /* Initialize MLM devices */ 8 | extern void init_mlmhw(); 9 | 10 | /* SD Card access */ 11 | extern int init_sdcard(); 12 | extern int read_sdcard(BYTE *buf, UINT32 n, UINT blks); 13 | extern int write_sdcard(BYTE *buf, UINT32 n); 14 | 15 | /* Get time from RTC */ 16 | extern UINT8 *get_time(); 17 | 18 | /* Is expansion board attached ? */ 19 | extern int mlmeb(); 20 | 21 | /* Read and write registers */ 22 | extern int _readreg(int regaddr); 23 | extern void _writereg(int regaddr, int d); 24 | 25 | /* SPI mode and rate */ 26 | extern int _mode_spi(int d); 27 | 28 | /* SPI data read/write */ 29 | extern char _xchg_spi(char d); 30 | 31 | #endif /* _MLMHW_H_ */ 32 | -------------------------------------------------------------------------------- /src/uSDimage/cpm/archive/aztec106d.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/archive/aztec106d.zip -------------------------------------------------------------------------------- /src/uSDimage/cpm/archive/ccgames.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/archive/ccgames.zip -------------------------------------------------------------------------------- /src/uSDimage/cpm/archive/cpm22-b.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/archive/cpm22-b.zip -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/ARCV.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/ARCV.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/AS.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/AS.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/C.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/C.LIB -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/CC.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/CC.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/CC.MSG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/CC.MSG -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/CNM.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/CNM.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/CRC.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/CRC.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/CZ.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/CZ.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/EXMPL.C: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | char buf[80]; 4 | printf("please enter your name: "); 5 | gets(buf); 6 | printf("hello, %s, welcome to the growing community of Aztec C users\n", buf); 7 | } 8 | 9 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/HEX80.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/HEX80.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/LIBC.REL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/LIBC.REL -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/LIBUTIL.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/LIBUTIL.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/LN.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/LN.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/M.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/M.LIB -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/MATH.REL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/MATH.REL -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/OVBGN.O: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/OVBGN.O -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/OVLOADER.O: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/OVLOADER.O -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/R.O: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/R.O -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/RBEGIN.O: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/RBEGIN.O -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/RBUILD.SUB: -------------------------------------------------------------------------------- 1 | as rext.asm 2 | ln -ro r.com r.o rext.o -lc 3 | pip r.lib=r.rsm[o],rbegin.o[o] 4 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/REXT.ASM: -------------------------------------------------------------------------------- 1 | extrn .begin 2 | extrn execv_ 3 | extrn execl_ 4 | extrn agetc_ 5 | extrn aputc_ 6 | extrn atoi_ 7 | extrn atol_ 8 | extrn calloc_ 9 | extrn Croot_ 10 | extrn fdopen_ 11 | extrn fgets_ 12 | extrn fopen_ 13 | extrn freopen_ 14 | extrn format_ 15 | extrn fprintf_ 16 | extrn fputs_ 17 | extrn fread_ 18 | extrn fscanf_ 19 | extrn fseek_ 20 | extrn ftell_ 21 | extrn fwrite_ 22 | extrn getchar_ 23 | extrn gets_ 24 | extrn getw_ 25 | extrn ioctl_ 26 | extrn isatty_ 27 | extrn lseek_ 28 | extrn realloc_ 29 | extrn malloc_ 30 | extrn free_ 31 | extrn creat_ 32 | extrn open_ 33 | extrn close_ 34 | extrn posit_ 35 | extrn printf_ 36 | extrn fclose_ 37 | extrn putchar_ 38 | extrn puterr_ 39 | extrn puts_ 40 | extrn putw_ 41 | extrn qsort_ 42 | extrn rename_ 43 | extrn scanfmt_ 44 | extrn scanf_ 45 | extrn setbuf_ 46 | extrn sprintf_ 47 | extrn sscanf_ 48 | extrn ungetc_ 49 | extrn unlink_ 50 | extrn bios_ 51 | extrn index_ 52 | extrn movmem_ 53 | extrn rindex_ 54 | extrn sbrk_ 55 | extrn rsvstk_ 56 | extrn setjmp_ 57 | extrn setmem_ 58 | extrn strcat_ 59 | extrn strncat_ 60 | extrn strcmp_ 61 | extrn strncmp_ 62 | extrn strcpy_ 63 | extrn strlen_ 64 | extrn strncpy_ 65 | extrn swapmem_ 66 | extrn toupper_ 67 | extrn tolower_ 68 | extrn getusr_ 69 | extrn setusr_ 70 | extrn rstusr_ 71 | extrn .dv,.ud 72 | extrn .ml 73 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/ROM.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/ROM.LIB -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/SIDSYM.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/SIDSYM.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/SQZ.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/SQZ.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/aztec106d/T.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/aztec106d/T.LIB -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK1/BOUNCE.BAS: -------------------------------------------------------------------------------- 1 | 5 PRINT CHR$(26):WIDTH 80 2 | 10 PRINT TAB(33);"BOUNCE":PRINT 3 | 20 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 30 PRINT:PRINT:PRINT 5 | 90 DIM T(20) 6 | 100 PRINT "THIS SIMULATION LETS YOU SPECIFY THE INITIAL VELOCITY" 7 | 110 PRINT "OF A BALL THROWN STRAIGHT UP, AND THE COEFFICIENT OF" 8 | 120 PRINT "ELASTICITY OF THE BALL. PLEASE USE A DECIMAL FRACTION" 9 | 130 PRINT "COEFFICIENCY (LESS THAN 1)." 10 | 131 PRINT 11 | 132 PRINT "YOU ALSO SPECIFY THE TIME INCREMENT TO BE USED IN" 12 | 133 PRINT "'STROBING' THE BALL'S FLIGHT (TRY .1 INITIALLY)." 13 | 134 PRINT 14 | 135 INPUT "TIME INCREMENT (SEC)";S2 15 | 140 PRINT 16 | 150 INPUT "VELOCITY (FPS)";V 17 | 160 PRINT 18 | 170 INPUT "COEFFICIENT";C 19 | 180 PRINT 20 | 182 PRINT "FEET" 21 | 184 PRINT 22 | 186 S1=INT(70/(V/(16*S2))) 23 | 190 FOR I=1 TO S1 24 | 200 T(I)=V*C^(I-1)/16 25 | 210 NEXT I 26 | 220 FOR H=INT(-16*(V/32)^2+V^2/32+.5) TO 0 STEP -.5 27 | 221 IF INT(H)<>H THEN 225 28 | 222 PRINT H; 29 | 225 L=0 30 | 230 FOR I=1 TO S1 31 | 240 FOR T=0 TO T(I) STEP S2 32 | 245 L=L+S2 33 | 250 IF ABS(H-(.5*(-32)*T^2+V*C^(I-1)*T))>.25 THEN 270 34 | 260 PRINT TAB(L/S2);"0"; 35 | 270 NEXT T 36 | 275 T=T(I+1)/2 37 | 276 IF -16*T^2+V*C^(I-1)*T0 THEN 90 10 | 25 PRINT "CORRECT AMOUNT, THANK YOU." 11 | 30 GOTO 400 12 | 90 IF C>0 THEN 120 13 | 95 PRINT "SORRY, YOU HAVE SHORT-CHANGED ME $";A-P 14 | 100 GOTO 10 15 | 120 PRINT "YOUR CHANGE, $";C 16 | 130 D=INT(C/10) 17 | 140 IF D=0 THEN 155 18 | 150 PRINT D;"TEN DOLLAR BILL(S)" 19 | 155 C=M-(D*10) 20 | 160 E=INT(C/5) 21 | 170 IF E=0 THEN 185 22 | 180 PRINT E;"FIVE DOLLARS BILL(S)" 23 | 185 C=M-(D*10+E*5) 24 | 190 F=INT(C) 25 | 200 IF F=0 THEN 215 26 | 210 PRINT F;"ONE DOLLAR BILL(S)" 27 | 215 C=M-(D*10+E*5+F) 28 | 220 C=C*100 29 | 225 N=C 30 | 230 G=INT(C/50) 31 | 240 IF G=0 THEN 255 32 | 250 PRINT G;"ONE HALF DOLLAR(S)" 33 | 255 C=N-(G*50) 34 | 260 H=INT(C/25) 35 | 270 IF H=0 THEN 285 36 | 280 PRINT H;"QUARTER(S)" 37 | 285 C=N-(G*50+H*25) 38 | 290 I=INT(C/10) 39 | 300 IF I=0 THEN 315 40 | 310 PRINT I;"DIME(S)" 41 | 315 C=N-(G*50+H*25+I*10) 42 | 320 J=INT(C/5) 43 | 330 IF J=0 THEN 345 44 | 340 PRINT J;"NICKEL(S)" 45 | 345 C=N-(G*50+H*25+I*10+J*5) 46 | 350 K=INT(C+.5) 47 | 360 IF K=0 THEN 380 48 | 370 PRINT K;"PENNY(S)" 49 | 380 PRINT "THANK YOU, COME AGAIN." 50 | 390 PRINT:PRINT 51 | 400 INPUT "AGAIN ";ANS$:PRINT 52 | 410 IF LEFT$(ANS$,1)="Y" GOTO 10 ELSE RUN "MENU" 53 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK1/CHEMIST.BAS: -------------------------------------------------------------------------------- 1 | 1 PRINT CHR$(26) 2 | 3 PRINT TAB(33);"CHEMST":PRINT 3 | 6 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 8 PRINT:PRINT:PRINT 5 | 10 PRINT "THE FICTITIOUS CHECMICAL KRYPTOCYANIC ACID CAN ONLY BE" 6 | 20 PRINT "DILUTED BY THE RATIO OF 7 PARTS WATER TO 3 PARTS ACID." 7 | 30 PRINT "IF ANY OTHER RATIO IS ATTEMPTED, THE ACID BECOMES UNSTABLE" 8 | 40 PRINT "AND SOON EXPLODES. GIVEN THE AMOUNT OF ACID, YOU MUST" 9 | 50 PRINT "DECIDE WHO MUCH WATER TO ADD FOR DILUTION. IF YOU MISS" 10 | 60 PRINT "YOU FACE THE CONSEQUENCES." 11 | 70 PRINT:PRINT 12 | 100 A=INT(RND(1)*50) 13 | 110 W=7*A/3 14 | 120 PRINT A;"LITERS OF KRYPTOCYANIC ACID. HOW MUCH WATER"; 15 | 130 INPUT R 16 | 140 D=ABS(W-R) 17 | 150 IF D>W/20 THEN 200 18 | 160 PRINT " GOOD JOB! YOU MAY BREATHE NOW, BUT DON'T INHALE THE FUMES!" 19 | 170 PRINT 20 | 180 GOTO 100 21 | 200 PRINT " SIZZLE! YOU HAVE JUST BEEN DESALINATED INTO A BLOB" 22 | 210 PRINT " OF QUIVERING PROTOPLASM!":PRINT 23 | 220 T=T+1 24 | 230 IF T=9 THEN 260 25 | 240 PRINT " HOWEVER, YOU MAY TRY AGAIN WITH ANOTHER LIFE.":PRINT 26 | 250 GOTO 100 27 | 260 PRINT " YOUR 9 LIVES ARE USED, BUT YOU WILL BE LONG REMEMBERED FOR" 28 | 270 PRINT " YOUR CONTRIBUTIONS TO THE FIELD OF COMIC BOOK CHEMISTRY." 29 | 275 PRINT:PRINT:PRINT 30 | 280 RUN "MENU" 31 | 999 INPUT L9 32 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK1/DEPTHCHG.BAS: -------------------------------------------------------------------------------- 1 | 1 PRINT CHR$(26):WIDTH 80 2 | 2 PRINT TAB(30);"DEPTH CHARGE":PRINT 3 | 4 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 6 PRINT: PRINT: PRINT 5 | 20 INPUT "DIMENSION OF SEARCH AREA";G: PRINT 6 | 30 N=INT(LOG(G)/LOG(2))+1 7 | 40 PRINT "YOU ARE THE CAPTAIN OF THE DESTROYER USS COMPUTER" 8 | 50 PRINT "AN ENEMY SUB HAS BEEN CAUSING YOU TROUBLE. YOUR" 9 | 60 PRINT "MISSION IS TO DESTROY IT. YOU HAVE";N;"SHOTS." 10 | 70 PRINT "SPECIFY DEPTH CHARGE EXPLOSION POINT WITH A" 11 | 80 PRINT "TRIO OF NUMBERS -- THE FIRST TWO ARE THE" 12 | 90 PRINT "SURFACE COORDINATES; THE THIRD IS THE DEPTH." 13 | 100 PRINT : PRINT "GOOD LUCK !": PRINT 14 | 110 A=INT(G*RND(1)) : B=INT(G*RND(1)) : C=INT(G*RND(1)) 15 | 120 FOR D=1 TO N : PRINT : PRINT "TRIAL #";D; : INPUT X,Y,Z 16 | 130 IF ABS(X-A)+ABS(Y-B)+ABS(Z-C)=0 THEN 300 17 | 140 GOSUB 500 : PRINT : NEXT D 18 | 200 PRINT : PRINT "YOU HAVE BEEN TORPEDOED! ABANDON SHIP!" 19 | 210 PRINT "THE SUBMARINE WAS AT";A;CHR$(8);",";B;CHR$(8);",";C;CHR$(8);"." : 20 | GOTO 400 21 | 300 PRINT : PRINT "B O O M ! ! YOU FOUND IT IN";D;"TRIES!" 22 | 400 PRINT : PRINT: INPUT "ANOTHER GAME (Y OR N)";A$ 23 | 410 IF LEFT$(A$,1)="Y" THEN 100 24 | 420 PRINT "OK. HOPE YOU ENJOYED YOURSELF." : GOTO 600 25 | 500 PRINT "SONAR REPORTS SHOT WAS "; 26 | 510 IF Y>B THEN PRINT "NORTH"; 27 | 520 IF YA THEN PRINT "EAST"; 29 | 540 IF XB OR X<>A THEN PRINT " AND"; 31 | 560 IF Z>C THEN PRINT " TOO LOW." 32 | 570 IF ZLEN(A$) THEN PRINT "!";:GOTO 50 17 | 34 PRINT MID$(A$,C,1); 18 | 36 C=C+1 19 | 50 NEXT A 20 | 53 IF M=Q THEN 60 21 | 55 PRINT TAB(R*M+(R-N)/2); 22 | 56 NEXT M 23 | 60 PRINT 24 | 70 NEXT N 25 | 83 IF X<>1 THEN 95 26 | 85 X=R-2:Y=1:Z=-2 27 | 90 GOTO 20 28 | 95 NEXT L 29 | 99 RUN "MENU" 30 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK1/DICE.BAS: -------------------------------------------------------------------------------- 1 | 1 PRINT CHR$(26):WIDTH 80 2 | 2 PRINT TAB(34);"DICE":PRINT 3 | 4 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 6 PRINT:PRINT:PRINT 5 | 10 DIM F(12) 6 | 20 REM DANNY FREIDUS 7 | 30 PRINT "THIS PROGRAM SIMULATES THE ROLLING OF A PAIR OF DICE." 8 | 50 PRINT "YOU ENTER THE NUMBER OF TIMES YOU WANT THE COMPUTER TO" 9 | 60 PRINT "'ROLL' THE DICE. WATCH OUT, VERY LARGE NUMBERS TAKE" 10 | 70 PRINT "A LONG TIME. IN PARTICULAR, NUMBERS OVER 5000." 11 | 80 FOR Q=1 TO 12 12 | 90 F(Q)=0 13 | 100 NEXT Q 14 | 110 PRINT:PRINT "HOW MANY ROLLS"; 15 | 120 INPUT X 16 | 130 FOR S=1 TO X 17 | 140 A=INT(6*RND(1)+1) 18 | 150 B=INT(6*RND(1)+1) 19 | 160 R=A+B 20 | 170 F(R)=F(R)+1 21 | 180 NEXT S 22 | 185 PRINT 23 | 190 PRINT "TOTAL SPOTS","NUMBER OF TIMES" 24 | 195 PRINT "-----------","---------------":PRINT 25 | 200 FOR V=2 TO 12 26 | 210 PRINT TAB(5);:PRINT USING "##";V;:PRINT "",:PRINT USING "#,###,###"; 27 | F(V) 28 | 220 NEXT V 29 | 221 PRINT 30 | 222 PRINT:PRINT "TRY AGAIN"; 31 | 223 INPUT Z$ 32 | 224 IF LEFT$(Z$,1)="Y" THEN 80 33 | 240 RUN "MENU" 34 |  35 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK1/GUESS.BAS: -------------------------------------------------------------------------------- 1 | 1 PRINT CHR$(26);TAB(33);"GUESS":PRINT 2 | 2 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 3 | 3 PRINT:PRINT:PRINT 4 | 4 PRINT "THIS IS A NUMBER GUESSING GAME. I'LL THINK" 5 | 5 PRINT "OF A NUMBER BETWEEN 1 AND ANY LIMIT YOU WANT." 6 | 6 PRINT "THEN YOU HAVE TO GUESS WHAT IT IS." 7 | 7 PRINT:PRINT "ENTER A NEGATIVE NUMBER TO QUIT.":PRINT 8 | 8 PRINT "WHAT LIMIT DO YOU WANT"; 9 | 9 INPUT L 10 | 10 PRINT 11 | 11 L1=INT(LOG(L)/LOG(2))+1 12 | 12 PRINT "I'M THINKING OF A NUMBER BETWEEN 1 AND";L;CHR$(8);"." 13 | 13 G=1 14 | 14 PRINT "NOW YOU TRY TO GUESS WHAT IT IS." 15 | 15 M=INT(L*RND(1)+1) 16 | 20 INPUT N 17 | 21 IF N>0 THEN 25 18 | 22 GOSUB 70 19 | 23 PRINT:INPUT "THANKS FOR THE GAME. DO YOU WANT TO PLAY AGAIN";ANS$: 20 | IF LEFT$(ANS$,1)="Y" THEN 1 ELSE PRINT:PRINT "GOODBYE.":PRINT:RUN "MENU" 21 | 25 IF N=M THEN 50 22 | 30 G=G+1 23 | 31 IF N>M THEN 40 24 | 32 PRINT "TOO LOW. TRY A BIGGER ANSWER." 25 | 33 GOTO 20 26 | 40 PRINT "TOO HIGH. TRY A SMALLER ANSWER." 27 | 42 GOTO 20 28 | 50 PRINT "THAT'S IT! YOU GOT IT IN";G;"TRIES." 29 | 52 IF GY THEN 270 19 | 250 PRINT "YOUR GUESS IS TOO LOW.":GOTO 280 20 | 270 PRINT "YOUR GUESS IS TOO HIGH." 21 | 280 PRINT:IF B<6 THEN 200 22 | 290 PRINT "YOU BLEW IT...TOO BAD...THE NUMBER WAS";Y;CHR$(8);"." 23 | 295 R=0:GOTO 350 24 | 300 PRINT "GOT IT!!!!!!!!!! YOU WIN";Y;"DOLLARS." 25 | 310 R=R+Y 26 | 320 PRINT "YOUR TOTAL WINNINGS ARE NOW";R;"DOLLARS." 27 | 350 PRINT:PRINT "PLAY AGAIN (YES OR NO)"; 28 | 360 INPUT A$:IF LEFT$(A$,1)="Y" THEN 170 29 | 380 PRINT:PRINT "SO LONG. HOPE YOU ENJOYED YOURSELF!!!" 30 | 390 RUN "MENU" 31 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK1/MENU.BAS: -------------------------------------------------------------------------------- 1 | 10 ' GAMES MENU PROGRAM 2 | 15 DIM GAME$(52) 3 | 16 ON ERROR GOTO 1000 4 | 20 PRINT CHR$(26):WIDTH 80 5 | 30 PRINT TAB(25);"GAMES MENU":PRINT TAB(25);"==========":PRINT 6 | 40 PRINT "The following game programs are available on this disc:":PRINT 7 | 50 FOR I=1 TO 52 8 | 60 READ GAME$(I) 9 | 70 NEXT 10 | 80 DATA ACEYDUCY,AMAZING,AMAZINGP,ANIMAL,AWARI,BAGELS,BANNER,BASKETBL 11 | 90 DATA BATNUM,BATTLE,BLACKJCK,BOMBARD,BOMBSAWY,BOUNCE,BOWLING,BOXING 12 | 100 DATA BUG,BULLFGHT,BULLSEYE,BUNNY,BUZZWORD,CALENDAR,CHANGE,CHECKERS 13 | 110 DATA CHEMIST,CHIEF,CHOMP,CIVILWAR,COMBAT,CRAPS,CUBE,DEPTHCHG 14 | 120 DATA DIAMOND,DICE,DIGITS,EVENWIN1,EVENWIN2,FLIPFLOP,FOOTBAL1 15 | 130 DATA FOOTBAL2,FURTRADR,GOLF,GOMOKO,GUESS,GUNNER,HAMURABI,HANGMAN 16 | 140 DATA HELLO,HEXAPAWN,HILO,HI-Q,HOCKEY 17 | 145 FOR I=1 TO 13 18 | 150 PRINT USING "\ \ \ \ \ \ \ \"; 19 | GAME$(I),GAME$(I+13),GAME$(I+26),GAME$(I+39) 20 | 160 NEXT 21 | 170 PRINT 22 | 180 LINE INPUT "Enter the name of your selection: ";CHOICE$ 23 | 190 IF CHOICE$="SYSTEM" THEN SYSTEM ELSE RUN CHOICE$ 24 | 1000 IF ERR=53 THEN PRINT "That file does not exist. Please re-enter.": 25 | CLOSE:FOR XX=1 TO 2000:NEXT:RESTORE:RESUME 20 26 | 1010 ON ERROR GOTO 0 27 | 1020 RESTORE:RESUME 20 28 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/HURKLE.BAS: -------------------------------------------------------------------------------- 1 | 1 RANDOMIZE 2 | 5 PRINT CHR$(26):WIDTH 80 3 | 10 PRINT TAB(33);"HURKLE":PRINT 4 | 20 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 5 | 30 PRINT:PRINT:PRINT 6 | 110 N=5 7 | 120 G=10 8 | 210 PRINT 9 | 220 PRINT "A HURKLE IS HIDING ON A";G;"BY";G;"GRID. HOMEBASE" 10 | 230 PRINT "ON THE GRID IS POINT 0,0 IN THE SOUTHWEST CORNER," 11 | 235 PRINT "AND ANY POINT ON THE GRID IS DESIGNATED BY A" 12 | 240 PRINT "PAIR OF WHOLE NUMBERS SEPERATED BY A COMMA. THE FIRST" 13 | 245 PRINT "NUMBER IS THE HORIZONTAL POSITION AND THE SECOND NUMBER" 14 | 246 PRINT "IS THE VERTICAL POSITION. YOU MUST TRY TO" 15 | 250 PRINT "GUESS THE HURKLE'S GRIDPOINT. YOU GET";N;"TRIES." 16 | 260 PRINT "AFTER EACH TRY, I WILL TELL YOU THE APPROXIMATE" 17 | 270 PRINT "DIRECTION TO GO TO LOOK FOR THE HURKLE." 18 | 280 PRINT 19 | 285 A=INT(G*RND(1)) 20 | 286 B=INT(G*RND(1)) 21 | 310 FOR K=1 TO N 22 | 320 PRINT "GUESS #";K; 23 | 330 INPUT X,Y 24 | 340 IF ABS(X-A)+ABS(Y-B)=0 THEN 500 25 | 350 REM PRINT INFO 26 | 360 GOSUB 610 27 | 370 PRINT 28 | 380 NEXT K 29 | 410 PRINT 30 | 420 PRINT "SORRY, THAT'S";N;"GUESSES." 31 | 430 PRINT "THE HURKLE IS AT ";A;",";B 32 | 440 PRINT 33 | 450 LINE INPUT "DO YOU WANT TO PLAY AGAIN? ";ANS$ 34 | 460 PRINT 35 | 470 IF LEFT$(ANS$,1)="Y" THEN 285 ELSE RUN "MENU" 36 | 500 REM 37 | 510 PRINT 38 | 520 PRINT "YOU FOUND HIM IN";K;"GUESSES!" 39 | 540 GOTO 440 40 | 610 PRINT "GO "; 41 | 620 IF Y=B THEN 670 42 | 630 IF YL THEN 480 18 | 460 PRINT "TOO LOW. TRY A HIGHER LETTER.": GOTO 410 19 | 480 PRINT "TOO HIGH. TRY A LOWER LETTER.": GOTO 410 20 | 500 PRINT: PRINT "YOU GOT IT IN";G;"GUESSES!!" 21 | 504 IF G<=5 THEN 508 22 | 506 PRINT "BUT IT SHOULDN'T TAKE MORE THAN 5 GUESSES!": GOTO 515 23 | 508 PRINT "GOOD JOB !!!!!" 24 | 510 FOR N=1 TO 15: PRINT CHR$(7);: NEXT N 25 | 515 PRINT 26 | 520 INPUT "DO YOU WANT TO TRY AGAIN";ANS$ 27 | 525 IF LEFT$(ANS$,1)="Y" THEN 310 ELSE RUN "MENU" 28 | 999 RUN "MENU" 29 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/LOVE-P.BAS: -------------------------------------------------------------------------------- 1 | 1 PRINT CHR$(26):WIDTH 80 2 | 2 PRINT TAB(33);"LOVE":PRINT 3 | 4 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 6 PRINT: PRINT: PRINT 5 | 20 PRINT "A TRIBUTE TO THE GREAT AMERICAN ARTIST, ROBERT INDIANA." 6 | 30 PRINT "HIS GREATEST WORK WILL BE REPRODUCED WITH A MESSAGE OF" 7 | 40 PRINT "YOUR CHOICE UP TO 60 CHARACTERS. IF YOU CAN'T THINK OF" 8 | 50 PRINT "A MESSAGE, SIMPLE TYPE THE WORD 'LOVE'": PRINT 9 | 60 INPUT "YOUR MESSAGE, PLEASE";A$: L=LEN(A$) 10 | 70 DIM T$(120): FOR I=1 TO 10: LPRINT: NEXT I 11 | 100 FOR J=0 TO INT(60/L) 12 | 110 FOR I=1 TO L 13 | 120 T$(J*L+I)=MID$(A$,I,1) 14 | 130 NEXT I: NEXT J 15 | 140 C=0 16 | 200 A1=1: P=1: C=C+1: IF C=37 THEN 999 17 | 205 LPRINT 18 | 210 READ A: A1=A1+A: IF P=1 THEN 300 19 | 240 FOR I=1 TO A: LPRINT " ";: NEXT I: P=1: GOTO 400 20 | 300 FOR I=A1-A TO A1-1: LPRINT T$(I);: NEXT I: P=0 21 | 400 IF A1>60 THEN 200 22 | 410 GOTO 210 23 | 600 DATA 60,1,12,26,9,12,3,8,24,17,8,4,6,23,21,6,4,6,22,12,5,6,5 24 | 610 DATA 4,6,21,11,8,6,4,4,6,21,10,10,5,4,4,6,21,9,11,5,4 25 | 620 DATA 4,6,21,8,11,6,4,4,6,21,7,11,7,4,4,6,21,6,11,8,4 26 | 630 DATA 4,6,19,1,1,5,11,9,4,4,6,19,1,1,5,10,10,4,4,6,18,2,1,6,8,11,4 27 | 640 DATA 4,6,17,3,1,7,5,13,4,4,6,15,5,2,23,5,1,29,5,17,8 28 | 650 DATA 1,29,9,9,12,1,13,5,40,1,1,13,5,40,1,4,6,13,3,10,6,12,5,1 29 | 660 DATA 5,6,11,3,11,6,14,3,1,5,6,11,3,11,6,15,2,1 30 | 670 DATA 6,6,9,3,12,6,16,1,1,6,6,9,3,12,6,7,1,10 31 | 680 DATA 7,6,7,3,13,6,6,2,10,7,6,7,3,13,14,10,8,6,5,3,14,6,6,2,10 32 | 690 DATA 8,6,5,3,14,6,7,1,10,9,6,3,3,15,6,16,1,1 33 | 700 DATA 9,6,3,3,15,6,15,2,1,10,6,1,3,16,6,14,3,1,10,10,16,6,12,5,1 34 | 710 DATA 11,8,13,27,1,11,8,13,27,1,60 35 | 999 FOR I=1 TO 10: LPRINT: NEXT I:RUN "MENU" 36 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/LOVE.BAS: -------------------------------------------------------------------------------- 1 | 1 PRINT CHR$(26):WIDTH 80 2 | 2 PRINT TAB(33);"LOVE":PRINT 3 | 4 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 6 PRINT: PRINT: PRINT 5 | 20 PRINT "A TRIBUTE TO THE GREAT AMERICAN ARTIST, ROBERT INDIANA." 6 | 30 PRINT "HIS GREATEST WORK WILL BE REPRODUCED WITH A MESSAGE OF" 7 | 40 PRINT "YOUR CHOICE UP TO 60 CHARACTERS. IF YOU CAN'T THINK OF" 8 | 50 PRINT "A MESSAGE, SIMPLE TYPE THE WORD 'LOVE'": PRINT 9 | 60 INPUT "YOUR MESSAGE, PLEASE";A$: L=LEN(A$) 10 | 70 DIM T$(120): FOR I=1 TO 10: PRINT: NEXT I 11 | 100 FOR J=0 TO INT(60/L) 12 | 110 FOR I=1 TO L 13 | 120 T$(J*L+I)=MID$(A$,I,1) 14 | 130 NEXT I: NEXT J 15 | 140 C=0 16 | 200 A1=1: P=1: C=C+1: IF C=37 THEN 999 17 | 205 PRINT 18 | 210 READ A: A1=A1+A: IF P=1 THEN 300 19 | 240 FOR I=1 TO A: PRINT " ";: NEXT I: P=1: GOTO 400 20 | 300 FOR I=A1-A TO A1-1: PRINT T$(I);: NEXT I: P=0 21 | 400 IF A1>60 THEN 200 22 | 410 GOTO 210 23 | 600 DATA 60,1,12,26,9,12,3,8,24,17,8,4,6,23,21,6,4,6,22,12,5,6,5 24 | 610 DATA 4,6,21,11,8,6,4,4,6,21,10,10,5,4,4,6,21,9,11,5,4 25 | 620 DATA 4,6,21,8,11,6,4,4,6,21,7,11,7,4,4,6,21,6,11,8,4 26 | 630 DATA 4,6,19,1,1,5,11,9,4,4,6,19,1,1,5,10,10,4,4,6,18,2,1,6,8,11,4 27 | 640 DATA 4,6,17,3,1,7,5,13,4,4,6,15,5,2,23,5,1,29,5,17,8 28 | 650 DATA 1,29,9,9,12,1,13,5,40,1,1,13,5,40,1,4,6,13,3,10,6,12,5,1 29 | 660 DATA 5,6,11,3,11,6,14,3,1,5,6,11,3,11,6,15,2,1 30 | 670 DATA 6,6,9,3,12,6,16,1,1,6,6,9,3,12,6,7,1,10 31 | 680 DATA 7,6,7,3,13,6,6,2,10,7,6,7,3,13,14,10,8,6,5,3,14,6,6,2,10 32 | 690 DATA 8,6,5,3,14,6,7,1,10,9,6,3,3,15,6,16,1,1 33 | 700 DATA 9,6,3,3,15,6,15,2,1,10,6,1,3,16,6,14,3,1,10,10,16,6,12,5,1 34 | 710 DATA 11,8,13,27,1,11,8,13,27,1,60 35 | 999 FOR I=1 TO 10: PRINT: NEXT I: RUN "MENU" 36 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/MENU.BAS: -------------------------------------------------------------------------------- 1 | 10 ' GAMES MENU PROGRAM 2 | 15 DIM GAME$(52) 3 | 16 ON ERROR GOTO 1000 4 | 20 PRINT CHR$(26):WIDTH 80 5 | 30 PRINT TAB(25);"GAMES MENU":PRINT TAB(25);"==========":PRINT 6 | 40 PRINT "The following game programs are available on this disc:":PRINT 7 | 50 FOR I=1 TO 50 8 | 60 READ GAME$(I) 9 | 70 NEXT 10 | 80 DATA 23-MATCH,DSPACE,GRANPRIX,HOCKEY1,HORSRACE,HURKLE,KINEMA,KING 11 | 90 DATA LEM,LETTER,LIFE2,LITQUIZ,LOVE,LOVE-P,MADLIBS,MASTRMND 12 | 100 DATA MATHDICE,MUGWUMP,NAME,NICOMA,NIM,NUMBER,ONECHECK,ORBIT 13 | 110 DATA PIZZA,POETRY,POKER,QUBIC,QUEEN,REVERSE,ROCKSP,ROULETTE 14 | 120 DATA RUSROU,SALVO,SINEWAVE,SLALOM,SPLAT,STARS,STOCK 15 | 130 DATA SYNONYM,TARGET,TICTAC1,TICTAC2,TOWERS,TRAIN,TRAP,WAR 16 | 140 DATA WEEKDAY,WORD,YAHTZEE 17 | 145 FOR I=1 TO 13 18 | 150 PRINT USING "\ \ \ \ \ \ \ \"; 19 | GAME$(I),GAME$(I+13),GAME$(I+26),GAME$(I+39) 20 | 160 NEXT 21 | 170 PRINT 22 | 180 LINE INPUT "Enter the name of your selection: ";CHOICE$ 23 | 190 IF CHOICE$="SYSTEM" THEN SYSTEM ELSE RUN CHOICE$ 24 | 1000 IF ERR=53 THEN PRINT "That file does not exist. Please re-enter.": 25 | CLOSE:FOR XX=1 TO 2000:NEXT:RESTORE:RESUME 20 26 | 1010 ON ERROR GOTO 0 27 | 1020 RESTORE:RESUME 20 28 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/NAME.BAS: -------------------------------------------------------------------------------- 1 | 1 PRINT CHR$(26):WIDTH 80:PRINT TAB(34);"NAME":PRINT 2 | 2 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 3 | 3 PRINT: PRINT: PRINT 4 | 5 DIM B$(40) 5 | 10 PRINT "HELLO.": PRINT "MY NAME IS CREATIVE COMPUTER." 6 | 20 PRINT "WHAT'S YOUR NAME (FIRST AND LAST";: INPUT A$: L=LEN(A$) 7 | 30 PRINT: PRINT "THANK YOU, "; 8 | 40 FOR I=1 TO L: B$(I)=MID$(A$,I,1): NEXT I 9 | 50 FOR I=L TO 1 STEP -1: PRINT B$(I);: NEXT I 10 | 60 PRINT ".": PRINT "OOPS! I GUESS I GOT IT BACKWARDS. A SMART" 11 | 70 PRINT "COMPUTER LIKE ME SHOULDN'T MAKE A MISTAKE LIKE THAT!": PRINT 12 | 80 PRINT "BUT I JUST NOTICED YOUR LETTERS ARE OUT OF ORDER." 13 | 90 PRINT "LET'S PUT THEM IN ORDER LIKE THIS: "; 14 | 100 FOR J=2 TO L: I=J-1: T$=B$(J) 15 | 110 IF T$>B$(I) THEN 130 16 | 120 B$(I+1)=B$(I): I=I-1: IF I>0 THEN 110 17 | 130 B$(I+1)=T$: NEXT J 18 | 140 FOR I=1 TO L: PRINT B$(I);: NEXT I: PRINT: PRINT 19 | 150 PRINT "DON'T YOU LIKE THAT BETTER";: INPUT D$ 20 | 160 IF D$="YES" THEN 180 21 | 170 PRINT: PRINT "I'M SORRY YOU DON'T LIKE IT THAT WAY.": GOTO 200 22 | 180 PRINT: PRINT "I KNEW YOU'D AGREE!!" 23 | 200 PRINT: PRINT "I REALLY ENJOYED MEETING YOU ";A$;"." 24 | 210 PRINT "HAVE A NICE DAY!" 25 | 999 RUN "MENU" 26 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/NICOMA.BAS: -------------------------------------------------------------------------------- 1 | 1 PRINT CHR$(26):WIDTH 80 2 | 2 PRINT TAB(33);"NICOMA":PRINT 3 | 4 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 6 PRINT: PRINT: PRINT 5 | 10 PRINT "BOOMERANG PUZZLE FROM ARITHMETICA OF NICOMACHUS -- A.D. 90!" 6 | 20 PRINT 7 | 30 PRINT "PLEASE THINK OF A NUMBER BETWEEN 1 AND 100.":PRINT 8 | 40 PRINT "YOUR NUMBER DIVIDED BY 3 HAS A REMAINDER OF"; 9 | 45 INPUT A 10 | 50 PRINT "YOUR NUMBER DIVIDED BY 5 HAS A REMAINDER OF"; 11 | 55 INPUT B 12 | 60 PRINT "YOUR NUMBER DIVIDED BY 7 HAS A REMAINDER OF"; 13 | 65 INPUT C 14 | 70 PRINT 15 | 80 PRINT "LET ME THINK A MOMENT..." 16 | 85 PRINT 17 | 90 FOR I=1 TO 1500: NEXT I 18 | 100 D=70*A+21*B+15*C 19 | 110 IF D<=105 THEN 140 20 | 120 D=D-105 21 | 130 GOTO 110 22 | 140 PRINT "YOUR NUMBER WAS";D;CHR$(8);", RIGHT"; 23 | 160 INPUT A$ 24 | 165 PRINT 25 | 170 IF LEFT$(A$,1)="Y" THEN 220 26 | 180 IF LEFT$(A$,1)="N" THEN 240 27 | 190 PRINT "EH? I DON'T UNDERSTAND '";A$;"' TRY 'YES' OR 'NO'." 28 | 200 GOTO 160 29 | 220 PRINT "HOW ABOUT THAT!!" 30 | 230 GOTO 250 31 | 240 PRINT "I FEEL YOUR ARITHMETIC IS IN ERROR." 32 | 250 PRINT 33 | 260 LINE INPUT "CARE TO TRY ANOTHER NUMBER? ";ANS$ 34 | 265 IF LEFT$(ANS$,1)="N" THEN 999 35 | 270 GOTO 20 36 | 999 RUN "MENU" 37 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/NUMBER.BAS: -------------------------------------------------------------------------------- 1 | 0 RANDOMIZE 2 | 1 PRINT CHR$(26):WIDTH 80:PRINT TAB(33);"NUMBER":PRINT 3 | 2 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 3 PRINT:PRINT:PRINT 5 | 4 PRINT "YOU HAVE 100 POINTS. BY GUESSING NUMBERS FROM 1 TO 5, YOU" 6 | 5 PRINT "CAN GAIN OR LOSE POINTS DEPENDING UPON HOW CLOSE YOU GET TO" 7 | 6 PRINT "A RANDOM NUMBER SELECTED BY THE COMPUTER.": PRINT 8 | 7 PRINT "YOU OCCASIONALLY WILL GET A JACKPOT WHICH WILL DOUBLE(!)" 9 | 8 PRINT "YOUR POINT COUNT. YOU WIN WHEN YOU GET 500 POINTS." 10 | 9 PRINT: P=100 11 | 10 DEF FNR(X)=INT(5*RND(1)+1) 12 | 12 INPUT "GUESS A NUMBER FROM 1 TO 5";G 13 | 15 R=FNR(1) 14 | 16 S=FNR(1) 15 | 17 T=FNR(1) 16 | 18 U=FNR(1) 17 | 19 V=FNR(1) 18 | 20 IF G=R THEN 30 19 | 21 IF G=S THEN 40 20 | 22 IF G=T THEN 50 21 | 23 IF G=U THEN 60 22 | 24 IF G=V THEN 70 23 | 25 IF G>5 THEN 12 24 | 30 P=P-5 25 | 35 GOTO 80 26 | 40 P=P+5 27 | 45 GOTO 80 28 | 50 P=P+P 29 | 53 PRINT "YOU HIT THE JACKPOT!!!" 30 | 55 GOTO 80 31 | 60 P=P+1 32 | 65 GOTO 80 33 | 70 P=P-(P*.5) 34 | 80 IF P>500 THEN 90 35 | 82 PRINT "YOU HAVE";P;"POINTS.":PRINT 36 | 83 IF P<=0 THEN PRINT "YOU RAN OUT OF POINTS. YOU LOSE!":GOTO 93 37 | 85 GOTO 12 38 | 90 PRINT "!!!!YOU WIN!!!! WITH ";P;"POINTS." 39 | 93 PRINT 40 | 95 INPUT "WOULD YOU LIKE TO PLAY AGAIN";ANS$ 41 | 96 IF LEFT$(ANS$,1)="Y" THEN 9 42 | 99 RUN "MENU" 43 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/ROCKSP.BAS: -------------------------------------------------------------------------------- 1 | 1 REM Modified by Jim Woolley, FOG Disk Librarian, 8/82 2 | 2 RANDOMIZE 3 | 5 PRINT CHR$(26):WIDTH 80 4 | 10 PRINT TAB(21);"GAME OF ROCK, SCISSORS, PAPER":PRINT 5 | 20 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 6 | 25 PRINT:PRINT:PRINT 7 | 30 INPUT "HOW MANY GAMES";Q 8 | 40 IF Q<11 THEN 60 9 | 50 PRINT "SORRY, BUT WE AREN'T ALLOWED TO PLAY THAT MANY.": GOTO 30 10 | 60 FOR G=1 TO Q 11 | 70 PRINT: PRINT "GAME NUMBER";G 12 | 80 X=INT(RND(1)*3+1) 13 | 90 PRINT "3=ROCK...2=SCISSORS...1=PAPER" 14 | 100 INPUT "1...2...3...WHAT'S YOUR CHOICE";K 15 | 110 IF (K-1)*(K-2)*(K-3)<>0 THEN PRINT "INVALID.": GOTO 90 16 | 120 PRINT "THIS IS MY CHOICE..." 17 | 130 ON X GOTO 140,150,160 18 | 140 PRINT "...PAPER": GOTO 170 19 | 150 PRINT "...SCISSORS": GOTO 170 20 | 160 PRINT "...ROCK" 21 | 170 IF X=K THEN 250 22 | 180 IF X>K THEN 230 23 | 190 IF X=1 THEN 210 24 | 200 PRINT "YOU WIN!!!":H=H+1: GOTO 260 25 | 210 IF K<>3 THEN 200 26 | 220 PRINT "WOW! I WIN!!!":C=C+1:GOTO 260 27 | 230 IF K<>1 OR X<>3 THEN 220 28 | 240 GOTO 200 29 | 250 PRINT "TIE GAME. NO WINNER." 30 | 260 NEXT G 31 | 270 PRINT: PRINT "HERE IS THE FINAL GAME SCORE:":PRINT 32 | 280 PRINT "I HAVE WON";C;"GAME";:IF C<>1 THEN PRINT "S" ELSE PRINT 33 | 290 PRINT "YOU HAVE WON";H;"GAME";:IF H<>1 THEN PRINT "S" ELSE PRINT 34 | 300 PRINT "AND";Q-(C+H);"GAME";:IF Q-(C+H) <> 1 THEN PRINT "S"; 35 | 301 PRINT " ENDED IN A TIE.":PRINT:PRINT 36 | 305 INPUT "DO YOU WANT TO PLAY AGAIN";ANS$ 37 | 306 IF LEFT$(ANS$,1)="Y" THEN H=0:C=0:GOTO 25 ELSE PRINT 38 | 310 PRINT: PRINT "THANKS FOR PLAYING!!" 39 | 320 RUN "MENU" 40 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/RUSROU.BAS: -------------------------------------------------------------------------------- 1 | 0 RANDOMIZE 2 | 1 PRINT CHR$(26):WIDTH 80:PRINT TAB(28);"RUSSIAN ROULETTE":PRINT 3 | 2 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 3 PRINT:PRINT:PRINT 5 | 5 PRINT "THIS IS A GAME OF >>>>>>>>>>RUSSIAN ROULETTE." 6 | 10 PRINT:PRINT "HERE IS A REVOLVER." 7 | 20 PRINT "TYPE '1' TO SPIN CHAMBER AND PULL TRIGGER." 8 | 22 PRINT "TYPE '2' TO GIVE UP.":PRINT:PRINT 9 | 23 PRINT "GO:":PRINT "==":PRINT 10 | 25 N=0 11 | 30 INPUT I 12 | 31 IF I<>2 THEN 35 13 | 32 PRINT " CHICKEN!!!!!" 14 | 33 GOTO 72 15 | 35 N=N+1 16 | 40 IF RND(1)>.833333 THEN 70 17 | 45 IF N>10 THEN 80 18 | 50 PRINT "- CLICK -" 19 | 60 PRINT: GOTO 30 20 | 70 PRINT " BANG!!!!! YOU'RE DEAD!" 21 | 71 PRINT "CONDOLENCES WILL BE SENT TO YOUR RELATIVES." 22 | 72 PRINT:PRINT:PRINT 23 | 75 INPUT "ANOTHER VICTIM";X$:IF LEFT$(X$,1)="Y" THEN 20 ELSE RUN "MENU" 24 | 80 PRINT "YOU WIN!!!!!" 25 | 85 PRINT "LET SOMEONE ELSE BLOW HIS BRAINS OUT." 26 | 90 GOTO 10 27 | 99 END 28 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/SINEWAVE.BAS: -------------------------------------------------------------------------------- 1 | 5 PRINT CHR$(26):WIDTH 80 2 | 10 PRINT TAB(30);"SINE WAVE":PRINT 3 | 20 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 30 PRINT:PRINT:PRINT 5 | 32 INPUT "ENTER TWO WORDS SEPARATED BY A COMMA ";F$,S$ 6 | 34 PRINT 7 | 36 LINE INPUT "ENTER 'RETURN' TO START THE PROGRAM. ";RESP$ 8 | 38 PRINT CHR$(26) 9 | 40 REM ARKABLE PROGRAM BY DAVID AHL 10 | 50 B=0 11 | 100 REM START LONG LOOP 12 | 110 FOR T=0 TO 40 STEP .25 13 | 120 A=INT(26+25*SIN(T)) 14 | 130 PRINT TAB(A); 15 | 140 IF B=1 THEN 180 16 | 150 PRINT F$ 17 | 160 B=1 18 | 170 GOTO 200 19 | 180 PRINT S$ 20 | 190 B=0 21 | 200 NEXT T 22 | 999 RUN "MENU" 23 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/TICTAC1.BAS: -------------------------------------------------------------------------------- 1 | 5 PRINT CHR$(26):WIDTH 80 2 | 10 PRINT TAB(30);"TIC TAC TOE":PRINT 3 | 20 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 30 PRINT:PRINT:PRINT 5 | 50 REM 6 | 100 REM THIS PROGRAM PLAYS TIC TAC TOE 7 | 110 REM THE MACHINE GOES FIRST 8 | 120 PRINT "THE GAME BOARD IS NUMBERED:": PRINT 9 | 130 PRINT "1 2 3": PRINT "8 9 4": PRINT "7 6 5" 10 | 140 PRINT 11 | 150 REM 12 | 160 REM 13 | 170 REM 14 | 180 DEF FNM(X)=X-8*INT((X-1)/8) 15 | 190 REM 16 | 200 REM MAIN PROGRAM 17 | 210 PRINT 18 | 220 PRINT 19 | 230 A=9 20 | 240 M=A 21 | 250 GOSUB 650 22 | 260 P=M 23 | 270 B=FNM(P+1) 24 | 280 M=B 25 | 290 GOSUB 650 26 | 300 Q=M 27 | 310 IF Q=FNM(B+4) THEN 360 28 | 320 C=FNM(B+4) 29 | 330 M=C 30 | 340 GOSUB 700 31 | 350 GOTO 730 32 | 360 C=FNM(B+2) 33 | 370 M=C 34 | 380 GOSUB 650 35 | 390 R=M 36 | 400 IF R=FNM(C+4) THEN 450 37 | 410 D=FNM(C+4) 38 | 420 M=D 39 | 430 GOSUB 700 40 | 440 GOTO 730 41 | 450 IF P/2<>INT(P/2) THEN 500 42 | 460 D=FNM(C+7) 43 | 470 M=D 44 | 480 GOSUB 700 45 | 490 GOTO 730 46 | 500 D=FNM(C+3) 47 | 510 M=D 48 | 520 GOSUB 650 49 | 530 S=M 50 | 540 IF S=FNM(D+4) THEN 590 51 | 550 E=FNM(D+4) 52 | 560 M=E 53 | 570 GOSUB 700 54 | 580 REM 55 | 590 E=FNM(D+6) 56 | 600 M=E 57 | 610 GOSUB 700 58 | 620 PRINT "THE GAME IS A DRAW." 59 | 630 GOTO 1000 60 | 640 REM 61 | 650 GOSUB 700 62 | 660 PRINT "YOUR MOVE"; 63 | 670 INPUT M 64 | 680 RETURN 65 | 700 PRINT "COMPUTER MOVES";M 66 | 710 RETURN 67 | 720 REM 68 | 730 PRINT "AND WINS ********" 69 | 740 GOTO 1000 70 | 750 END 71 | 1000 INPUT "PLAY AGAIN";ANS$ 72 | 1010 IF LEFT$(ANS$,1)="Y" THEN 30 ELSE RUN "MENU" 73 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/DISK2/TRAIN.BAS: -------------------------------------------------------------------------------- 1 | 0 RANDOMIZE 2 | 1 PRINT CHR$(26):WIDTH 80:PRINT TAB(33);"TRAIN":PRINT 3 | 2 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 4 | 3 PRINT: PRINT: PRINT 5 | 4 PRINT "TIME - SPEED DISTANCE EXERCISE": PRINT 6 | 10 C=INT(25*RND(1))+40 7 | 15 D=INT(15*RND(1))+5 8 | 20 T=INT(19*RND(1))+20 9 | 25 PRINT " A CAR TRAVELING";C;"MPH CAN MAKE A CERTAIN TRIP IN" 10 | 30 PRINT D;"HOURS LESS THAN A TRAIN TRAVELING AT";T;"MPH." 11 | 33 PRINT 12 | 35 PRINT "HOW LONG DOES THE TRIP TAKE BY CAR"; 13 | 40 INPUT A 14 | 45 V=D*T/(C-T) 15 | 50 E=INT(ABS((V-A)*100/A)+.5) 16 | 55 IF E>5 THEN 70 17 | 60 PRINT "GOOD! ANSWER WITHIN";E;"PERCENT." 18 | 65 GOTO 80 19 | 70 PRINT "SORRY. YOU WERE OFF BY";E;"PERCENT." 20 | 80 PRINT "CORRECT ANSWER IS";V;"HOURS." 21 | 90 PRINT 22 | 95 PRINT "ANOTHER PROBLEM (YES OR NO)"; 23 | 100 INPUT A$ 24 | 105 PRINT 25 | 110 IF LEFT$(A$,1)="Y" THEN PRINT:GOTO 10 26 | 999 RUN "MENU" 27 |  -------------------------------------------------------------------------------- /src/uSDimage/cpm/ccgames/FILE_ID.DIZ: -------------------------------------------------------------------------------- 1 | Creative Computing's BASIC Games 2 | -------------------------------------------------------------------------------- /src/uSDimage/cpm/cpm22utl/ASM.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/cpm22utl/ASM.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/cpm22utl/DDT.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/cpm22utl/DDT.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/cpm22utl/DSKMAINT.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/cpm22utl/DSKMAINT.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/cpm22utl/DUMP.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/cpm22utl/DUMP.ASM -------------------------------------------------------------------------------- /src/uSDimage/cpm/cpm22utl/DUMP.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/cpm22utl/DUMP.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/cpm22utl/ED.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/cpm22utl/ED.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/cpm22utl/LOAD.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/cpm22utl/LOAD.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/cpm22utl/PIP.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/cpm22utl/PIP.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/cpm22utl/STAT.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/cpm22utl/STAT.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/cpm22utl/SUBMIT.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/cpm22utl/SUBMIT.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/cpm22utl/XSUB.COM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/cpm22utl/XSUB.COM -------------------------------------------------------------------------------- /src/uSDimage/cpm/diskimg/images.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/diskimg/images.zip -------------------------------------------------------------------------------- /src/uSDimage/cpm/doc/Aztec_C_1.06_User_Manual_Mar84.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/doc/Aztec_C_1.06_User_Manual_Mar84.pdf -------------------------------------------------------------------------------- /src/uSDimage/cpm/doc/cpm22-m.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/doc/cpm22-m.pdf -------------------------------------------------------------------------------- /src/uSDimage/cpm/doc/mbasic-80.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/doc/mbasic-80.pdf -------------------------------------------------------------------------------- /src/uSDimage/cpm/mbasic/ascii.bas: -------------------------------------------------------------------------------- 1 | 10 MAXITER = 20 2 | 20 LET C$ = " .,'~!^:;[/<&?oxOX# " 3 | 30 FOR Y = -39 TO 39 4 | 40 FOR X = -39 TO 39 5 | 50 CREAL = X / 20 6 | 70 CIMAG = Y / 20 7 | 80 ZREAL = CREAL 8 | 90 ZIMAG = CIMAG 9 | 95 COUNT = 1 10 | 100 ZM = ZREAL * ZREAL 11 | 105 ZN = ZIMAG * ZIMAG 12 | 107 ZL = ZM + ZN 13 | 110 IF ZL > 4 THEN GOTO 170 14 | 120 ZR2 = ZM - ZN + CREAL 15 | 130 ZIMAG = ZREAL * ZIMAG * 2 + CIMAG 16 | 140 ZREAL = ZR2 17 | 150 COUNT = COUNT + 1 18 | 160 IF COUNT < MAXITER THEN GOTO 100 19 | 170 PRINT MID$(C$, 1 + COUNT, 1); 20 | 180 NEXT X 21 | 185 PRINT "" 22 | 190 NEXT Y 23 | NT = COUNT + -------------------------------------------------------------------------------- /src/uSDimage/cpm/mbasic/mbasic.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/mbasic/mbasic.com -------------------------------------------------------------------------------- /src/uSDimage/cpm/romutil/cpm.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/romutil/cpm.rom -------------------------------------------------------------------------------- /src/uSDimage/cpm/romutil/ez80.h: -------------------------------------------------------------------------------- 1 | /* eZ80 register I/O address definitions */ 2 | #define FLASH_KEY 0xF5 3 | #define FLASH_DATA 0xF6 4 | #define FLASH_FDIV 0xF9 5 | #define FLASH_PROT 0xFA 6 | #define FLASH_PAGE 0xFC 7 | #define FLASH_ROW 0xFD 8 | #define FLASH_COL 0xFE 9 | #define FLASH_PGCTL 0xFF 10 | 11 | /* Hop over to eZ80 ADL mode to do this I/O */ 12 | #define readreg(a) bios(7, a, 0) 13 | #define writereg(a, d) bios(6, a, d) 14 | -------------------------------------------------------------------------------- /src/uSDimage/cpm/romutil/lisp.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/cpm/romutil/lisp.rom -------------------------------------------------------------------------------- /src/uSDimage/cpm/romutil/romcmp.c: -------------------------------------------------------------------------------- 1 | /* Read flash rom and compare with file */ 2 | #include 3 | #include "ez80.h" 4 | 5 | #define SIZE 262144 6 | 7 | int main(argc, argv) 8 | int argc; 9 | char *argv[]; 10 | { 11 | unsigned char c; 12 | long i; 13 | FILE *fp; 14 | 15 | /* Check arguments */ 16 | if (!(argc == 2)) { 17 | printf("Usage: romcmp \n"); 18 | return 1; 19 | } 20 | 21 | /* Open file for reading */ 22 | fp = fopen(argv[1], "r"); 23 | if (!fp) { 24 | printf("Couldn't open file \"%s\"", argv[1]); 25 | return 1; 26 | } 27 | 28 | /* Set frequency divider for 50 MHz */ 29 | while (!(readreg(FLASH_FDIV) == 255)) { 30 | writereg(FLASH_KEY, 0xB6); 31 | writereg(FLASH_KEY, 0x49); 32 | writereg(FLASH_FDIV, 255); 33 | } 34 | 35 | /* Reset flash I/O access counter */ 36 | writereg(FLASH_PAGE, 0); 37 | writereg(FLASH_ROW, 0); 38 | writereg(FLASH_COL, 0); 39 | 40 | /* Read flash and file a byte at a time, and compare */ 41 | printf("Reading flash and file "); 42 | i = 0; 43 | while (i < SIZE) { 44 | if (((c = fgetc(fp)) == -1) || !(c == readreg(FLASH_DATA))) { 45 | break; 46 | } 47 | ++i; 48 | if (!(i % 1024)) { 49 | printf("."); 50 | } 51 | } 52 | 53 | fclose(fp); 54 | printf(" %ld\n", i); 55 | } 56 | -------------------------------------------------------------------------------- /src/uSDimage/cpm/romutil/romimg.c: -------------------------------------------------------------------------------- 1 | /* Read flash rom and save to file */ 2 | #include 3 | #include "ez80.h" 4 | 5 | #define SIZE 262144L 6 | 7 | int main(argc, argv) 8 | int argc; 9 | char *argv[]; 10 | { 11 | long i; 12 | FILE *fp; 13 | 14 | /* Check arguments */ 15 | if (!(argc == 2)) { 16 | printf("Usage: romimg \n"); 17 | return 1; 18 | } 19 | 20 | /* Open file for writing */ 21 | fp = fopen(argv[1], "w"); 22 | if (!fp) { 23 | printf("Couldn't open file %s\n", argv[1]); 24 | return 1; 25 | } 26 | 27 | /* Set frequency divider for 50 MHz */ 28 | while (!(readreg(FLASH_FDIV)) == 255)) { 29 | writereg(FLASH_KEY, 0xB6); 30 | writereg(FLASH_KEY, 0x49); 31 | writereg(FLASH_FDIV, 255); 32 | } 33 | 34 | /* Reset flash I/O access counter */ 35 | writereg(FLASH_PAGE, 0); 36 | writereg(FLASH_ROW, 0); 37 | writereg(FLASH_COL, 0); 38 | 39 | /* Read flash a byte at a time, and write it out */ 40 | printf("Reading flash "); 41 | i = 0; 42 | while (i < SIZE) { 43 | if (fputc(readreg(FLASH_DATA), fp) == -1) { 44 | printf("\nError writing to file \"%s\"\n", argv[1]); 45 | fclose(fp); 46 | return 1; 47 | } 48 | ++i; 49 | if (!(i % 1024)) { 50 | printf("."); 51 | } 52 | } 53 | 54 | printf(" %ld\n", i); 55 | fclose(fp); 56 | 57 | return 0; 58 | } 59 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/blankrom.l: -------------------------------------------------------------------------------- 1 | ; Blank, mass erase flash rom 2 | (define blankrom 3 | (lambda () 4 | 5 | ; Warning 6 | (while (keyp) (getchar)) 7 | (print '"Warning ! This will erase the flash rom COMPLETELY !\n") 8 | (print '"Use this utility ONLY if you can reprogram the flash\n") 9 | (print '"afterwards, with the Zilog debugger/programmer tool.\n") 10 | (print '"Press any key to continue, or \^C to abort ... ") 11 | (getchar) 12 | (print '\n) 13 | 14 | ; Set frequency divider for 50 MHz 15 | (while (not (= 255 (readreg (FLASH_FDIV)))) 16 | (writereg (FLASH_KEY) 0xB6) 17 | (writereg (FLASH_KEY) 0x49) 18 | (writereg (FLASH_FDIV) 255)) 19 | 20 | ; Unprotect flash rom 21 | (while (not (= 0 (readreg (FLASH_PROT)))) 22 | (writereg (FLASH_KEY) 0xB6) 23 | (writereg (FLASH_KEY) 0x49) 24 | (writereg (FLASH_PROT) 0)) 25 | 26 | ; Mass erase 27 | (writereg (FLASH_PGCTL) 1) 28 | '"")) 29 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/cat.l: -------------------------------------------------------------------------------- 1 | ; Open, read a file, and print it out 2 | (define cat 3 | (lambda (fnam) 4 | (define f (fopen fnam 'r)) 5 | (if (zerop f) 6 | (error (cats '"? Couldn't open file \"" fnam '"\""))) 7 | (define c) 8 | (while (not (= (setq c (fgetc f)) -1)) 9 | (print (int2sym c))) 10 | (fclose f) 11 | '"")) 12 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/cload.l: -------------------------------------------------------------------------------- 1 | ; Load palette entry for fg, bg with rgb color values 2 | (define cload 3 | (lambda (f b fc bc) 4 | (print '"\e[Y") 5 | (putchar f) 6 | (putchar b) 7 | (putchar fc) 8 | (putchar bc) 9 | (cls))) 10 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/cls.l: -------------------------------------------------------------------------------- 1 | ; Clear screen 2 | (define cls 3 | (lambda () (print '"\e[2J\e[H"))) 4 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/color.l: -------------------------------------------------------------------------------- 1 | ; Set fg, bg color from ANSI palette 2 | (define color 3 | (lambda (f b) 4 | (print 5 | (cats 6 | '"\e[" 7 | (if (zerop (& f 0x08)) '"22" '"1") 8 | '";" 9 | (sprintf '"%d" (+ (& f 0x07) 30)) 10 | '";" 11 | (sprintf '"%d" (+ (& b 0x07) 40)) 12 | '"m")) 13 | (cls))) 14 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/dc.l: -------------------------------------------------------------------------------- 1 | ; Set fg, bg color directly 2 | (define dc 3 | (lambda (f b) 4 | (print '"\e[Y") 5 | (putchar f) 6 | (putchar b) 7 | (cls))) 8 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/delay.l: -------------------------------------------------------------------------------- 1 | ; Delay 2 | (define delay 3 | (lambda (n) 4 | (if (not (zerop n)) (delay (- n 1))))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/ls.l: -------------------------------------------------------------------------------- 1 | ; Directory/file listing utility 2 | (define ls 3 | (lambda args 4 | (if (if args (or (cdr args) (not (symbolp (car args))))) 5 | (error '"? Argument to \"ls\" must be a symbol")) 6 | 7 | (if args 8 | (if (not (opendir (car args))) 9 | (error (cats '"? Can't open directory \"" (car args) '"\""))) 10 | (opendir)) 11 | 12 | (define fname) 13 | (while 't 14 | (setq fname (lsitem)) 15 | (if (eq fname '"") 16 | (break)) 17 | (nlprint fname)) 18 | 19 | (closedir) 20 | '"")) 21 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/romcmp.l: -------------------------------------------------------------------------------- 1 | ; Read flash rom and compare with file 2 | (define romcmp 3 | (lambda (fnam) 4 | 5 | (define SIZE (macro () 262144)) 6 | 7 | ; Open file for reading 8 | (define f (fopen fnam 'r)) 9 | (if (zerop f) 10 | (error (cats '"? Couldn't open file \"" fnam '"\""))) 11 | 12 | ; Set frequency divider for 50 MHz 13 | (while (not (= 255 (readreg (FLASH_FDIV)))) 14 | (writereg (FLASH_KEY) 0xB6) 15 | (writereg (FLASH_KEY) 0x49) 16 | (writereg (FLASH_FDIV) 255)) 17 | 18 | ; Reset flash I/O access counter 19 | (writereg (FLASH_PAGE) 0) 20 | (writereg (FLASH_ROW) 0) 21 | (writereg (FLASH_COL) 0) 22 | 23 | ; Read flash and file a byte at a time, and compare 24 | (print '"Reading flash and file ") 25 | (define c) 26 | (define i 0) 27 | (while (< i (SIZE)) 28 | (if 29 | (or (= (setq c (fgetc f)) -1) (not (= c (readreg (FLASH_DATA))))) 30 | (break)) 31 | (setq i (+ i 1)) 32 | (if (zerop (% i 1024)) 33 | (print '"."))) 34 | (fclose f) 35 | (print '" ") 36 | i)) 37 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/romimg.l: -------------------------------------------------------------------------------- 1 | ; Read flash rom and save to file 2 | (include ') 3 | 4 | (define romimg 5 | (lambda (fnam) 6 | 7 | (define SIZE (macro () 262144)) 8 | 9 | ; Open file for writing 10 | (define f (fopen fnam 'w)) 11 | (if (zerop f) 12 | (error (cats '"? Couldn't open file \"" fnam '"\""))) 13 | 14 | ; Set frequency divider for 50 MHz 15 | (while (not (= 255 (readreg (FLASH_FDIV)))) 16 | (writereg (FLASH_KEY) 0xB6) 17 | (writereg (FLASH_KEY) 0x49) 18 | (writereg (FLASH_FDIV) 255)) 19 | 20 | ; Reset flash I/O access counter 21 | (writereg (FLASH_PAGE) 0) 22 | (writereg (FLASH_ROW) 0) 23 | (writereg (FLASH_COL) 0) 24 | 25 | ; Read flash a byte at a time, and write it out 26 | (print '"Reading flash ") 27 | (define i 0) 28 | (while (< i (SIZE)) 29 | (if (= (fputc (readreg (FLASH_DATA)) f) -1) 30 | (progn 31 | (print '\n) 32 | (fclose f) 33 | (error (cats '"? Error writing to file \"" fnam '"\"")))) 34 | (setq i (+ i 1)) 35 | (if (zerop (% i 1024)) 36 | (print '"."))) 37 | (fclose f) 38 | (print '" ") 39 | i)) 40 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/romupd.l: -------------------------------------------------------------------------------- 1 | ; Read rom image file and update flash rom 2 | (include ') 3 | 4 | (define romupd 5 | (lambda (fnam) 6 | 7 | (define SIZE (macro () 262144)) 8 | 9 | ; Open file for reading 10 | (define f (fopen fnam 'r)) 11 | (if (zerop f) 12 | (error (cats '"? Couldn't open file \"" fnam '"\""))) 13 | 14 | ; Warning 15 | (while (keyp) (getchar)) 16 | (print '"Warning ! This will erase the flash rom COMPLETELY !\n") 17 | (print '"A new image will then be loaded to the flash rom.\n") 18 | (print '"Press any key to continue, or \^C to abort ... ") 19 | (getchar) 20 | (print '\n\n) 21 | 22 | ; Set frequency divider for 50 MHz 23 | (while (not (= 255 (readreg (FLASH_FDIV)))) 24 | (writereg (FLASH_KEY) 0xB6) 25 | (writereg (FLASH_KEY) 0x49) 26 | (writereg (FLASH_FDIV) 255)) 27 | 28 | ; Unprotect flash rom 29 | (while (not (= 0 (readreg (FLASH_PROT)))) 30 | (writereg (FLASH_KEY) 0xB6) 31 | (writereg (FLASH_KEY) 0x49) 32 | (writereg (FLASH_PROT) 0)) 33 | 34 | ; Mass erase 35 | (writereg (FLASH_PGCTL) 1) 36 | 37 | ; Reset flash I/O access counter 38 | (writereg (FLASH_PAGE) 0) 39 | (writereg (FLASH_ROW) 0) 40 | (writereg (FLASH_COL) 0) 41 | 42 | ; Read file and write to flash, byte by byte 43 | (print '"Writing flash ") 44 | (define c) 45 | (define i 0) 46 | (while (< i (SIZE)) 47 | (if (= (setq c (fgetc f)) -1) 48 | (progn 49 | (print '\n) 50 | (fclose f) 51 | (error (cats '"? Error reading file \"" fnam '"\"")))) 52 | (writereg (FLASH_DATA) c) 53 | (setq i (+ i 1)) 54 | (if (zerop (% i 1024)) 55 | (print '"."))) 56 | (fclose f) 57 | (print '" ") 58 | i)) 59 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/rv.l: -------------------------------------------------------------------------------- 1 | ; Set/clear reverse video attribute 2 | (define rv 3 | (lambda (r) 4 | (print (cats '"\e[" (if r '"7" '"27") '"m")) 5 | (cls))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/bin/termid.l: -------------------------------------------------------------------------------- 1 | ; Get terminal identification 2 | (define termid 3 | (lambda () 4 | (putchar (sym2int '"^E")) 5 | (delay 100) 6 | (define s '"") 7 | (while (keyp) (setq s (cats s (int2sym (getchar))))) 8 | s)) 9 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/benchtak.l: -------------------------------------------------------------------------------- 1 | (define tak 2 | (lambda (x y z) 3 | (if (< y x) 4 | (tak (tak (- x 1) y z) 5 | (tak (- y 1) z x) 6 | (tak (- z 1) x y)) 7 | z))) 8 | 9 | (define looptak 10 | (lambda (n) 11 | (if (zerop n) 12 | n 13 | (progn 14 | (tak 18 12 6) 15 | (looptak (- n 1)))))) 16 | 17 | (define benchtak 18 | (lambda () 19 | (nlprint (time)) 20 | (looptak 10) 21 | (nlprint (time)))) 22 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/blinky.l: -------------------------------------------------------------------------------- 1 | ; Blink user LED 2 | (define blinky 3 | (lambda () 4 | (led '()) (delay 10000) (led 't) (delay 10000) (blinky))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/chartest.l: -------------------------------------------------------------------------------- 1 | ; Create symbol containing all 256 CP 437 characters 2 | (define chartest 3 | (lambda args 4 | (let ((i (if (integerp (car args)) (car args) 0)) (s '"\e[11m")) 5 | (while (< i 256) 6 | (if (< i 32) (setq s (cats s '\e))) 7 | (if (= i 32) (setq s (cats s '"\e[10m"))) 8 | (setq s (cats s (int2sym i))) 9 | (setq i (+ i 1))) 10 | s))) 11 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/colordemo.l: -------------------------------------------------------------------------------- 1 | ; This is the MakerLisp program that is running now 2 | (define colordemo 3 | (lambda () 4 | (define _colordemo 5 | (lambda (n) 6 | (let ((b (>> (& n 0xE0) 5)) (f (>> (& n 0x1E) 1)) (a (& n 1))) 7 | (if (not (= f b)) 8 | (progn 9 | (color f b) (rv (not (zerop a))) 10 | (print '"FG/BG color ") (print f) (print '"/") (print b) 11 | (if (not (zerop a)) (print '" (reversed)")) (print '\n\n) 12 | (print csym) (print '\n\n) (print fsym) (delay 10000)))) 13 | (_colordemo (+ n 1)))) 14 | (define csym 15 | (if (zerop (& (readreg (PB_DR)) 0x02)) (chartest 32) (chartest))) 16 | (define fsym (fcat '"/demo/colordemo.l")) 17 | (_colordemo 0))) 18 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/fact.l: -------------------------------------------------------------------------------- 1 | (define fact (lambda (n) (if (zerop n) 1 (* n (fact (- n 1)))))) 2 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/fcat.l: -------------------------------------------------------------------------------- 1 | ; Open and read a file, and return the contents as a symbol 2 | (define fcat 3 | (lambda (fnam) 4 | (define f (fopen fnam 'r)) 5 | (if (zerop f) 6 | (error (cats '"? Couldn't open file '" fnam '"'"))) 7 | (define text '"") 8 | (define c) 9 | (while (not (= (setq c (fgetc f)) -1)) 10 | (setq text (cats text (int2sym c)))) 11 | (fclose f) 12 | text)) 13 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/hello.l: -------------------------------------------------------------------------------- 1 | (define hello 2 | (macro () 3 | (forget 'hello) 4 | `'"Hello from MakerLisp !\n")) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/led.l: -------------------------------------------------------------------------------- 1 | ; Clear or set PA7 for 'blinky' LED 2 | (define led 3 | (lambda (on) 4 | (if on (regbset (PA_DR) 7) (regbclr (PA_DR) 7)) 5 | (gpout (PA_DR) 7))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/loopsieve.l: -------------------------------------------------------------------------------- 1 | ; Loop on (sieve 750) 2 | (define loopsieve 3 | (lambda () 4 | (define i 1) 5 | (define s) 6 | (while 't 7 | (nlprint i) 8 | (setq s (sieve 750)) 9 | (nlprint s) 10 | (setq i (+ i 1))))) 11 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/looptime.l: -------------------------------------------------------------------------------- 1 | (define looptime (lambda () (nlprint (cats (date) '" " (time))) (looptime))) 2 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/sieve.l: -------------------------------------------------------------------------------- 1 | ; Simplest, lisp-iest sieve ever 2 | (include ') 3 | 4 | ; Generate list of integers for input to lsieve 5 | (define ilist 6 | (lambda (a n) 7 | (if (< n 2) 8 | a 9 | (ilist (cons n a) (- n 1))))) 10 | 11 | ; Copy a list, excluding multiples of the specified integer 12 | (define copynm 13 | (lambda (l n) 14 | (if l 15 | (if (zerop (% (car l) n)) 16 | (copynm (cdr l) n) 17 | (cons (car l) (copynm (cdr l) n)))))) 18 | 19 | ; Lsieve takes a list of integers and returns the list of primes within 20 | (define lsieve 21 | (lambda (l) 22 | (if l 23 | (cons (car l) (lsieve (copynm (cdr l) (car l))))))) 24 | 25 | ; Sieve finds list of primes up to and including specified number 26 | (define sieve 27 | (lambda (n) 28 | (lsieve (ilist '() n)))) 29 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/spidev.l: -------------------------------------------------------------------------------- 1 | ; SPI device object maker 2 | (define spidev 3 | (lambda (reg bit mode rate) 4 | 5 | ; Old mode and rate to restore 6 | (define oldmr) 7 | 8 | ; Select, deselect 9 | (define select 10 | (macro () 11 | `(writereg ,reg (_iand (readreg ,reg) ,(~ (<< 1 bit)))))) 12 | 13 | (define deselect 14 | (macro () 15 | `(writereg ,reg (_ior (readreg ,reg) ,(<< 1 bit))))) 16 | 17 | ; Take control of and relinquish SPI bus 18 | (define spiacq 19 | (slambda () 20 | (setq oldmr (spimode ("|" (<< rate 8) mode))) 21 | (select))) 22 | 23 | (define spirel 24 | (slambda () 25 | (deselect) 26 | (spimode oldmr))) 27 | 28 | ; Return methods specialized by object parameters 29 | (define mlist 30 | (list 31 | (cons 'spiacq spiacq) 32 | (cons 'spirel spirel))) 33 | (define f 34 | (lambda (m) 35 | (if (define f (cdr (assq m mlist))) 36 | f 37 | (error (cats '"? spidev: Unknown method: '" m '"'\n"))))) 38 | 39 | ; Set pin used for /CS as GPIO output, initially de-selected 40 | (regbset reg bit) 41 | (gpout reg bit) 42 | 43 | f)) 44 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/stack.l: -------------------------------------------------------------------------------- 1 | ; Stack object maker 2 | (define stack 3 | (lambda () 4 | (define this-stack '()) 5 | (define push 6 | (lambda (x) 7 | (setq this-stack (cons x this-stack)))) 8 | (define pop 9 | (lambda () 10 | (let ((v (car this-stack))) (setq this-stack (cdr this-stack)) v))) 11 | (define get 12 | (lambda () 13 | this-stack)) 14 | (define mlist (list (cons 'push push) (cons 'pop pop) (cons 'get get))) 15 | (define f 16 | (lambda (m) 17 | (if (define f (cdr (assq m mlist))) 18 | f 19 | (error (cats '"? stack: Unknown operation: '" m '"'\n"))))) 20 | f)) 21 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/demo/wp.l: -------------------------------------------------------------------------------- 1 | (define wp 2 | (lambda () 3 | (color 6 4))) 4 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/etc/cpm.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/lisp/etc/cpm.rom -------------------------------------------------------------------------------- /src/uSDimage/lisp/etc/cpmdiska.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/lisp/etc/cpmdiska.img -------------------------------------------------------------------------------- /src/uSDimage/lisp/etc/rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/lisp/etc/rom -------------------------------------------------------------------------------- /src/uSDimage/lisp/etc/usbkb.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/lisp/etc/usbkb.rom -------------------------------------------------------------------------------- /src/uSDimage/lisp/etc/vga1024.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/lisp/etc/vga1024.rom -------------------------------------------------------------------------------- /src/uSDimage/lisp/etc/vga640.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/lisp/etc/vga640.rom -------------------------------------------------------------------------------- /src/uSDimage/lisp/etc/vga720.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/uSDimage/lisp/etc/vga720.rom -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/#fseek.l#: -------------------------------------------------------------------------------- 1 | (define fseek 2 | (macro (fp offset whence) 3 | (forget 'fseek) 4 | `(ffcall 'fseek '(int (void* double int)) (list fp )))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/atoi.l: -------------------------------------------------------------------------------- 1 | (define atoi 2 | (macro args 3 | (forget 'atoi) 4 | `(ffcall 'atoi '(int (char*)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/ceil.l: -------------------------------------------------------------------------------- 1 | (define ceil 2 | (macro args 3 | (forget 'ceil) 4 | `(ffcall 'ceil '(double (double)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/fclose.l: -------------------------------------------------------------------------------- 1 | (define fclose 2 | (macro args 3 | (forget 'fclose) 4 | `(ffcall 'fclose '(int (void*)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/fgetc.l: -------------------------------------------------------------------------------- 1 | (define fgetc 2 | (macro args 3 | (forget 'fgetc) 4 | `(ffcall 'fgetc '(int (void*)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/floor.l: -------------------------------------------------------------------------------- 1 | (define floor 2 | (macro args 3 | (forget 'floor) 4 | `(ffcall 'floor '(double (double)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/fopen.l: -------------------------------------------------------------------------------- 1 | (define fopen 2 | (macro args 3 | (forget 'fopen) 4 | `(ffcall 'fopen '(void* (char* char*)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/fputc.l: -------------------------------------------------------------------------------- 1 | (define fputc 2 | (macro args 3 | (forget 'fputc) 4 | `(ffcall 'fputc '(int (int void*)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/fseek.l: -------------------------------------------------------------------------------- 1 | (define fseek 2 | (macro args 3 | (forget 'fseek) 4 | `(ffcall 'fseek '(int (void* double int)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/getchar.l: -------------------------------------------------------------------------------- 1 | ; Get character from stdin 2 | (define getchar 3 | (macro () 4 | (forget 'getchar) 5 | `(fgetc (stdin)))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/isalpha.l: -------------------------------------------------------------------------------- 1 | (define isalpha 2 | (macro args 3 | (forget 'isalpha) 4 | `(ffcall 'isalpha '(int (int)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/isdigit.l: -------------------------------------------------------------------------------- 1 | (define isdigit 2 | (macro args 3 | (forget 'isdigit) 4 | `(ffcall 'isdigit '(int (int)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/isspace.l: -------------------------------------------------------------------------------- 1 | (define isspace 2 | (macro args 3 | (forget 'isspace) 4 | `(ffcall 'isspace '(int (int)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/pow.l: -------------------------------------------------------------------------------- 1 | (define pow 2 | (macro args 3 | (forget 'pow) 4 | `(ffcall 'pow '(double (double double)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/putchar.l: -------------------------------------------------------------------------------- 1 | ; Put character to stdout 2 | (define putchar 3 | (macro (c) 4 | (forget 'putchar) 5 | `(fputc ,c (stdout)))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/rewind.l: -------------------------------------------------------------------------------- 1 | (define rewind 2 | (macro args 3 | (forget 'rewind) 4 | `(ffcall 'rewind '(int (void*)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/sprintf.l: -------------------------------------------------------------------------------- 1 | (define sprintf 2 | (macro args 3 | (forget 'sprintf) 4 | `(ffcall 'sprintf '(char* (char* ?)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/sqrt.l: -------------------------------------------------------------------------------- 1 | (define sqrt 2 | (macro args 3 | (forget 'sqrt) 4 | `(ffcall 'sqrt '(double (double)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/stderr.l: -------------------------------------------------------------------------------- 1 | (define stderr 2 | (macro args 3 | (forget 'stderr) 4 | `(ffcall 'stderr '(void* ()) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/stdin.l: -------------------------------------------------------------------------------- 1 | (define stdin 2 | (macro args 3 | (forget 'stdin) 4 | `(ffcall 'stdin '(void* ()) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/stdio.l: -------------------------------------------------------------------------------- 1 | ; Standard I/O streams 2 | (if (boundp '_STDIO_L_) (eof) (define _STDIO_L_)) 3 | 4 | (discard (define STDIN (stdin))) 5 | (discard (define STDOUT (stdout))) 6 | (discard (define STDERR (stderr))) 7 | (define EOF -1) 8 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/stdout.l: -------------------------------------------------------------------------------- 1 | (define stdout 2 | (macro args 3 | (forget 'stdout) 4 | `(ffcall 'stdout '(void* ()) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/toupper.l: -------------------------------------------------------------------------------- 1 | (define toupper 2 | (macro args 3 | (forget 'toupper) 4 | `(ffcall 'toupper '(int (int)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/clib/ungetc.l: -------------------------------------------------------------------------------- 1 | (define ungetc 2 | (macro args 3 | (forget 'ungetc) 4 | `(ffcall 'ungetc '(int (int void*)) (list ,@args)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/FLASH_COL.l: -------------------------------------------------------------------------------- 1 | ; FLASH_COL register 2 | (define FLASH_COL 3 | (macro () 4 | (forget 'FLASH_COL) 5 | 0xFE)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/FLASH_DATA.l: -------------------------------------------------------------------------------- 1 | ; FLASH_DATA register 2 | (define FLASH_DATA 3 | (macro () 4 | (forget 'FLASH_DATA) 5 | 0xF6)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/FLASH_FDIV.l: -------------------------------------------------------------------------------- 1 | ; FLASH_FDIV register 2 | (define FLASH_FDIV 3 | (macro () 4 | (forget 'FLASH_FDIV) 5 | 0xF9)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/FLASH_KEY.l: -------------------------------------------------------------------------------- 1 | ; FLASH_KEY register 2 | (define FLASH_KEY 3 | (macro () 4 | (forget 'FLASH_KEY) 5 | 0xF5)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/FLASH_PAGE.l: -------------------------------------------------------------------------------- 1 | ; FLASH_PAGE register 2 | (define FLASH_PAGE 3 | (macro () 4 | (forget 'FLASH_PAGE) 5 | 0xFC)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/FLASH_PGCTL.l: -------------------------------------------------------------------------------- 1 | ; FLASH_PGCTL register 2 | (define FLASH_PGCTL 3 | (macro () 4 | (forget 'FLASH_PGCTL) 5 | 0xFF)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/FLASH_PROT.l: -------------------------------------------------------------------------------- 1 | ; FLASH_PROT register 2 | (define FLASH_PROT 3 | (macro () 4 | (forget 'FLASH_PROT) 5 | 0xFA)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/FLASH_ROW.l: -------------------------------------------------------------------------------- 1 | ; FLASH_ROW register 2 | (define FLASH_ROW 3 | (macro () 4 | (forget 'FLASH_ROW) 5 | 0xFD)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PA_ALT1.l: -------------------------------------------------------------------------------- 1 | ; PA_ALT1 register 2 | (define PA_ALT1 3 | (macro () 4 | (forget 'PA_ALT1) 5 | 0x98)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PA_ALT2.l: -------------------------------------------------------------------------------- 1 | ; PA_ALT2 register 2 | (define PA_ALT2 3 | (macro () 4 | (forget 'PA_ALT2) 5 | 0x99)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PA_DDR.l: -------------------------------------------------------------------------------- 1 | ; PA_DDR register 2 | (define PA_DDR 3 | (macro () 4 | (forget 'PA_DDR) 5 | 0x97)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PA_DR.l: -------------------------------------------------------------------------------- 1 | ; PA_DR register 2 | (define PA_DR 3 | (macro () 4 | (forget 'PA_DR) 5 | 0x96)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PB_ALT1.l: -------------------------------------------------------------------------------- 1 | ; PB_ALT1 register 2 | (define PB_ALT1 3 | (macro () 4 | (forget 'PB_ALT1) 5 | 0x9C)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PB_ALT2.l: -------------------------------------------------------------------------------- 1 | ; PB_ALT2 register 2 | (define PB_ALT2 3 | (macro () 4 | (forget 'PB_ALT2) 5 | 0x9D)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PB_DDR.l: -------------------------------------------------------------------------------- 1 | ; PB_DDR register 2 | (define PB_DDR 3 | (macro () 4 | (forget 'PB_DDR) 5 | 0x9B)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PB_DR.l: -------------------------------------------------------------------------------- 1 | ; PB_DR register 2 | (define PB_DR 3 | (macro () 4 | (forget 'PB_DR) 5 | 0x9A)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PC_ALT1.l: -------------------------------------------------------------------------------- 1 | ; PC_ALT1 register 2 | (define PC_ALT1 3 | (macro () 4 | (forget 'PC_ALT1) 5 | 0xA0)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PC_ALT2.l: -------------------------------------------------------------------------------- 1 | ; PC_ALT2 register 2 | (define PC_ALT2 3 | (macro () 4 | (forget 'PC_ALT2) 5 | 0xA1)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PC_DDR.l: -------------------------------------------------------------------------------- 1 | ; PC_DDR register 2 | (define PC_DDR 3 | (macro () 4 | (forget 'PC_DDR) 5 | 0x9F)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PC_DR.l: -------------------------------------------------------------------------------- 1 | ; PC_DR register 2 | (define PC_DR 3 | (macro () 4 | (forget 'PC_DR) 5 | 0x9E)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PD_ALT1.l: -------------------------------------------------------------------------------- 1 | ; PD_ALT1 register 2 | (define PD_ALT1 3 | (macro () 4 | (forget 'PD_ALT1) 5 | 0xA4)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PD_ALT2.l: -------------------------------------------------------------------------------- 1 | ; PD_ALT2 register 2 | (define PD_ALT2 3 | (macro () 4 | (forget 'PD_ALT2) 5 | 0xA5)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PD_DDR.l: -------------------------------------------------------------------------------- 1 | ; PD_DDR register 2 | (define PD_DDR 3 | (macro () 4 | (forget 'PD_DDR) 5 | 0xA3)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/PD_DR.l: -------------------------------------------------------------------------------- 1 | ; PD_DR register 2 | (define PD_DR 3 | (macro () 4 | (forget 'PD_DR) 5 | 0xA2)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/RTC_CEN.l: -------------------------------------------------------------------------------- 1 | ; RTC_CEN register 2 | (define RTC_CEN 3 | (macro () 4 | (forget 'RTC_CEN) 5 | 0xE7)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/RTC_CTRL.l: -------------------------------------------------------------------------------- 1 | ; RTC_CTRL register 2 | (define RTC_CTRL 3 | (macro () 4 | (forget 'RTC_CTRL) 5 | 0xED)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/RTC_DOM.l: -------------------------------------------------------------------------------- 1 | ; RTC_DOM register 2 | (define RTC_DOM 3 | (macro () 4 | (forget 'RTC_DOM) 5 | 0xE4)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/RTC_DOW.l: -------------------------------------------------------------------------------- 1 | ; RTC_DOW register 2 | (define RTC_DOW 3 | (macro () 4 | (forget 'RTC_DOW) 5 | 0xE3)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/RTC_HRS.l: -------------------------------------------------------------------------------- 1 | ; RTC_HRS register 2 | (define RTC_HRS 3 | (macro () 4 | (forget 'RTC_HRS) 5 | 0xE2)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/RTC_MIN.l: -------------------------------------------------------------------------------- 1 | ; RTC_MIN register 2 | (define RTC_MIN 3 | (macro () 4 | (forget 'RTC_MIN) 5 | 0xE1)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/RTC_MON.l: -------------------------------------------------------------------------------- 1 | ; RTC_MON register 2 | (define RTC_MON 3 | (macro () 4 | (forget 'RTC_MON) 5 | 0xE5)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/RTC_SEC.l: -------------------------------------------------------------------------------- 1 | ; RTC_SEC register 2 | (define RTC_SEC 3 | (macro () 4 | (forget 'RTC_SEC) 5 | 0xE0)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/RTC_YR.l: -------------------------------------------------------------------------------- 1 | ; RTC_YR register 2 | (define RTC_YR 3 | (macro () 4 | (forget 'RTC_YR) 5 | 0xE6)) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/gpin.l: -------------------------------------------------------------------------------- 1 | ; Set GPIO pin mode to input 2 | (define gpin 3 | (lambda (r b) ; r: P?_DR 4 | (regbset (+ r 1) b) ; 1: P?_DDR 5 | (regbclr (+ r 2) b) ; 2: P?_ALT1 6 | (regbclr (+ r 3) b))) ; 3: P?_ALT2 7 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/gpod.l: -------------------------------------------------------------------------------- 1 | ; Set GPIO pin mode to open drain 2 | (define gpod 3 | (lambda (r b) ; r: P?_DR 4 | (regbclr (+ r 1) b) ; 1: P?_DDR 5 | (regbset (+ r 2) b) ; 2: P?_ALT1 6 | (regbclr (+ r 3) b))) ; 3: P?_ALT2 7 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/gpout.l: -------------------------------------------------------------------------------- 1 | ; Set GPIO pin mode to output 2 | (define gpout 3 | (lambda (r b) ; r: P?_DR 4 | (regbclr (+ r 1) b) ; 1: P?_DDR 5 | (regbclr (+ r 2) b) ; 2: P?_ALT1 6 | (regbclr (+ r 3) b))) ; 3: P?_ALT2 7 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/regbclr.l: -------------------------------------------------------------------------------- 1 | ; Clear a bit in a register 2 | (define regbclr 3 | (macro (r b) 4 | (forget 'regbclr) 5 | `(writereg ,r (& (readreg ,r) (~ (<< 1 ,b)))))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/regbmask.l: -------------------------------------------------------------------------------- 1 | ; Generate a bit mask, constant expression if possible 2 | (define regbmask 3 | (macro (b) 4 | (if (integerp b) 5 | `(constant (<< 1 ,b)) 6 | `(<< 1 ,b)))) 7 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/regbread.l: -------------------------------------------------------------------------------- 1 | ; Read a bit in a register 2 | (define regbread 3 | (macro (r b) 4 | (forget 'regbread) 5 | `(& (>> (readreg ,r) ,b) 1))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/regbset.l: -------------------------------------------------------------------------------- 1 | ; Set a bit in a register 2 | (define regbset 3 | (macro (r b) 4 | (forget 'regbset) 5 | `(writereg ,r ("|" (readreg ,r) (<< 1 ,b))))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/ez80/regbwrite.l: -------------------------------------------------------------------------------- 1 | ; Write a bit in a register 2 | (define regbwrite 3 | (macro (r b d) 4 | (forget 'regbwrite) 5 | `(writereg ,r ("|" (& (readreg ,r) (~ (<< 1 ,b))) (<< (& ,d 1) ,b))))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/_greater.l: -------------------------------------------------------------------------------- 1 | ; Two argument greater than 2 | (define _greater 3 | (macro (x y) 4 | (forget '_greater) 5 | `(_less ,y ,x))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/_greaterorequal.l: -------------------------------------------------------------------------------- 1 | ; Two argument greater than or equal 2 | (define _greaterorequal 3 | (macro (x y) 4 | (forget '_greaterorequal) 5 | `(not (_less ,x ,y)))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/_land.l: -------------------------------------------------------------------------------- 1 | ; Two argument logical and 2 | (define _land 3 | (macro (x y) 4 | (forget '_land) 5 | `(if ,x ,y))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/_lessorequal.l: -------------------------------------------------------------------------------- 1 | ; Two argument less than or equal 2 | (define _lessorequal 3 | (macro (x y) 4 | (forget '_lessorequal) 5 | `(not (_greater ,x ,y)))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/_lor.l: -------------------------------------------------------------------------------- 1 | ; Two argument logical or 2 | (define _lor 3 | (macro (x y) 4 | (forget '_lor) 5 | (define temp (gensym)) 6 | `(let ((,temp ,x)) 7 | (if ,temp ,temp ,y)))) 8 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/add.l: -------------------------------------------------------------------------------- 1 | ; Sum of n arguments 2 | (define add 3 | (macro args 4 | (forget 'add) 5 | `(n-ary add _add 0 ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/and.l: -------------------------------------------------------------------------------- 1 | ; Logical, short-circuiting and of n arguments 2 | (define and 3 | (macro args 4 | (forget 'and) 5 | `(n-ary and _land 't ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/append.l: -------------------------------------------------------------------------------- 1 | ; n-ary append macro 2 | (define append 3 | (macro args 4 | (forget 'append) 5 | `(n-ary append _append '() ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/apply.l: -------------------------------------------------------------------------------- 1 | ; Apply a macro or lambda to a list of arguments 2 | (define apply 3 | (macro (f args) 4 | (forget 'apply) 5 | 6 | (define _quoteargs 7 | (lambda (args) 8 | (if (not args) 9 | '() 10 | (cons (list 'quote (car args)) (_quoteargs (cdr args)))))) 11 | 12 | (define _apply 13 | (lambda (f args) 14 | (eval (cons 'f (_quoteargs args))))) 15 | 16 | `(',_apply ,f ,args))) 17 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/arithmetic.l: -------------------------------------------------------------------------------- 1 | ; Arithmetic aliases 2 | (if (boundp '_ARITHMETIC_L_) (eof) (define _ARITHMETIC_L_)) 3 | 4 | (include ') 5 | 6 | ; Equality of n arguments 7 | (define = (macro args `(equal ,@args))) 8 | 9 | ; Ascending order of n arguments 10 | (define < (macro args `(less ,@args))) 11 | 12 | ; Descending order of n arguments 13 | (define > (macro args `(greater ,@args))) 14 | 15 | ; Monotonic ascending order of n arguments 16 | (define <= (macro args `(lessorequal ,@args))) 17 | 18 | ; Monotonic descending order of n arguments 19 | (define >= (macro args `(greaterorequal ,@args))) 20 | 21 | ; Sum of n arguments 22 | (define + (macro args `(add ,@args))) 23 | 24 | ; Difference of n arguments 25 | (define - (macro args `(sub ,@args))) 26 | 27 | ; Product of n arguments 28 | (define * (macro args `(mul ,@args))) 29 | 30 | ; Quotient of n arguments 31 | (define / (macro args `(div ,@args))) 32 | 33 | ; Bitwise integer and of n arguments 34 | (define & (macro args `(iand ,@args))) 35 | 36 | ; Bitwise integer or of n arguments 37 | (define "|" (macro args `(ior ,@args))) 38 | 39 | ; Bitwise integer xor of n arguments 40 | (define ^ (macro args `(ixor ,@args))) 41 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/assoc.l: -------------------------------------------------------------------------------- 1 | ; Search a-list for match (eql) 2 | (define assoc 3 | (macro (i l) 4 | (forget 'assoc) 5 | 6 | (define _assoc 7 | (lambda (i l) 8 | (if (not l) 9 | l 10 | (if (eql i (caar l)) 11 | (car l) 12 | (_assoc i (cdr l)))))) 13 | 14 | `(',_assoc ,i ,l))) 15 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/assq.l: -------------------------------------------------------------------------------- 1 | ; Search a-list for match (eq) 2 | (define assq 3 | (macro (i l) 4 | (forget 'assq) 5 | 6 | (define _assq 7 | (lambda (i l) 8 | (if (not l) 9 | l 10 | (if (eq i (caar l)) 11 | (car l) 12 | (_assq i (cdr l)))))) 13 | 14 | `(',_assq ,i ,l))) 15 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/atom.l: -------------------------------------------------------------------------------- 1 | ; An atom is not a pair 2 | (define atom 3 | (macro (x) 4 | (forget 'atom) 5 | `(not (pairp ,x)))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/backquote.l: -------------------------------------------------------------------------------- 1 | ; backquote macro implementation 2 | (if (boundp '_BACKQUOTE_L_) (eof) (define _BACKQUOTE_L_)) 3 | 4 | ; Two arg append needed globally by backquote, also used by n-ary append macro 5 | (define _append 6 | (lambda (front back) 7 | (if (not front) 8 | back 9 | (progn 10 | (if (not (pairp front)) 11 | (error '"? All but last argument of \"_append\" must be lists")) 12 | (cons (car front) (_append (cdr front) back)))))) 13 | 14 | ; One level backquote 15 | 16 | ; Construct an expression that builds the expression - when executed, 17 | ; unquoted things will be evaluated in the environment of the caller 18 | (define _backquote 19 | (lambda (x) 20 | 21 | (if (not (pairp x)) 22 | (list 'quote x) 23 | 24 | (if (eq (car x) 'unquote) 25 | (car (cdr x)) 26 | 27 | (if (if (pairp (car x)) (eq (car (car x)) 'unquote-splicing)) 28 | (list '_append (car (cdr (car x))) (_backquote (cdr x))) 29 | 30 | (list 'cons (_backquote (car x)) (_backquote (cdr x)))))))) 31 | 32 | (define backquote 33 | (macro (x) 34 | (_backquote x))) 35 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/caaaar.l: -------------------------------------------------------------------------------- 1 | (define caaaar 2 | (macro (x) 3 | (forget 'caaaar) 4 | `(car (caaar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/caaadr.l: -------------------------------------------------------------------------------- 1 | (define caaadr 2 | (macro (x) 3 | (forget 'caaadr) 4 | `(car (caadr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/caaar.l: -------------------------------------------------------------------------------- 1 | (define caaar 2 | (macro (x) 3 | (forget 'caaar) 4 | `(car (caar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/caadar.l: -------------------------------------------------------------------------------- 1 | (define caadar 2 | (macro (x) 3 | (forget 'caadar) 4 | `(car (cadar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/caaddr.l: -------------------------------------------------------------------------------- 1 | (define caaddr 2 | (macro (x) 3 | (forget 'caaddr) 4 | `(car (caddr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/caadr.l: -------------------------------------------------------------------------------- 1 | (define caadr 2 | (macro (x) 3 | (forget 'caadr) 4 | `(car (cadr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/caar.l: -------------------------------------------------------------------------------- 1 | (define caar 2 | (macro (x) 3 | (forget 'caar) 4 | `(car (car ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cadaar.l: -------------------------------------------------------------------------------- 1 | (define cadaar 2 | (macro (x) 3 | (forget 'cadaar) 4 | `(car (cdaar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cadadr.l: -------------------------------------------------------------------------------- 1 | (define cadadr 2 | (macro (x) 3 | (forget 'cadadr) 4 | `(car (cdadr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cadar.l: -------------------------------------------------------------------------------- 1 | (define cadar 2 | (macro (x) 3 | (forget 'cadar) 4 | `(car (cdar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/caddar.l: -------------------------------------------------------------------------------- 1 | (define caddar 2 | (macro (x) 3 | (forget 'caddar) 4 | `(car (cddar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cadddr.l: -------------------------------------------------------------------------------- 1 | (define cadddr 2 | (macro (x) 3 | (forget 'cadddr) 4 | `(car (cdddr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/caddr.l: -------------------------------------------------------------------------------- 1 | (define caddr 2 | (macro (x) 3 | (forget 'caddr) 4 | `(car (cddr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cadr.l: -------------------------------------------------------------------------------- 1 | (define cadr 2 | (macro (x) 3 | (forget 'cadr) 4 | `(car (cdr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/case.l: -------------------------------------------------------------------------------- 1 | ; case statement implementation 2 | (define case 3 | (macro (casexpr . cases) 4 | 5 | (forget 'case) 6 | 7 | (define kbreak (gensym)) 8 | (define keyval (gensym)) 9 | 10 | (define _eql 11 | (lambda (x y) 12 | (if (and (numberp x) (numberp y)) 13 | (= x y) 14 | (eq x y)))) 15 | 16 | (define vmult 17 | (lambda (acase) 18 | (if (not (caar acase)) 19 | '() 20 | (cons (cons (caar acase) (cdr acase)) 21 | (vmult (cons (cdar acase) (cdr acase))))))) 22 | 23 | (define case-test 24 | (lambda (acase) 25 | (if (or (eq (car acase) 'otherwise) (eq (car acase) 't)) 26 | `(,kbreak (progn ,@(cdr acase))) 27 | `(if (',_eql ,keyval ',(car acase)) 28 | (,kbreak (progn ,@(cdr acase))))))) 29 | 30 | (define tests 31 | (lambda (cases) 32 | (if (not cases) 33 | '() 34 | (if (pairp (caar cases)) 35 | (append (tests (vmult (car cases))) (tests (cdr cases))) 36 | (cons (case-test (car cases)) (tests (cdr cases))))))) 37 | 38 | `(call/cc 39 | (lambda (,kbreak) 40 | (define ,keyval ,casexpr) 41 | ,@(tests cases))))) 42 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cats.l: -------------------------------------------------------------------------------- 1 | ; n-ary cats macro 2 | (define cats 3 | (macro args 4 | (forget 'cats) 5 | `(n-ary cats _cats '"" ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cdaaar.l: -------------------------------------------------------------------------------- 1 | (define cdaaar 2 | (macro (x) 3 | (forget 'cdaaar) 4 | `(cdr (caaar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cdaadr.l: -------------------------------------------------------------------------------- 1 | (define cdaadr 2 | (macro (x) 3 | (forget 'cdaadr) 4 | `(cdr (caadr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cdaar.l: -------------------------------------------------------------------------------- 1 | (define cdaar 2 | (macro (x) 3 | (forget 'cdaar) 4 | `(cdr (caar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cdadar.l: -------------------------------------------------------------------------------- 1 | (define cdadar 2 | (macro (x) 3 | (forget 'cdadar) 4 | `(cdr (cadar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cdaddr.l: -------------------------------------------------------------------------------- 1 | (define cdaddr 2 | (macro (x) 3 | (forget 'cdaddr) 4 | `(cdr (caddr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cdadr.l: -------------------------------------------------------------------------------- 1 | (define cdadr 2 | (macro (x) 3 | (forget 'cdadr) 4 | `(cdr (cadr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cdar.l: -------------------------------------------------------------------------------- 1 | (define cdar 2 | (macro (x) 3 | (forget 'cdar) 4 | `(cdr (car ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cddaar.l: -------------------------------------------------------------------------------- 1 | (define cddaar 2 | (macro (x) 3 | (forget 'cddaar) 4 | `(cdr (cdaar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cddadr.l: -------------------------------------------------------------------------------- 1 | (define cddadr 2 | (macro (x) 3 | (forget 'cddadr) 4 | `(cdr (cdadr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cddar.l: -------------------------------------------------------------------------------- 1 | (define cddar 2 | (macro (x) 3 | (forget 'cddar) 4 | `(cdr (cdar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cdddar.l: -------------------------------------------------------------------------------- 1 | (define cdddar 2 | (macro (x) 3 | (forget 'cdddar) 4 | `(cdr (cddar ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cddddr.l: -------------------------------------------------------------------------------- 1 | (define cddddr 2 | (macro (x) 3 | (forget 'cddddr) 4 | `(cdr (cdddr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cdddr.l: -------------------------------------------------------------------------------- 1 | (define cdddr 2 | (macro (x) 3 | (forget 'cdddr) 4 | `(cdr (cddr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cddr.l: -------------------------------------------------------------------------------- 1 | (define cddr 2 | (macro (x) 3 | (forget 'cddr) 4 | `(cdr (cdr ,x)))) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/cond.l: -------------------------------------------------------------------------------- 1 | ; cond statement implementation 2 | (define cond 3 | (macro clauses 4 | 5 | (forget 'cond) 6 | 7 | (define kbreak (gensym)) 8 | (define tstval (gensym)) 9 | 10 | (define clause-test 11 | (lambda (clause) 12 | (if (not (cdr clause)) 13 | `(if (define ,tstval ,(car clause)) (,kbreak ,tstval)) 14 | `(if ,(car clause) (,kbreak (progn ,@(cdr clause))))))) 15 | 16 | (define tests 17 | (lambda (clauses) 18 | (if (not clauses) 19 | '() 20 | (cons (clause-test (car clauses)) (tests (cdr clauses)))))) 21 | 22 | `(call/cc 23 | (lambda (,kbreak) 24 | ,@(tests clauses))))) 25 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/constant.l: -------------------------------------------------------------------------------- 1 | ; Create a constant expression 2 | (define constant 3 | (macro (x) 4 | (forget 'constant) 5 | (eval `,x))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/div.l: -------------------------------------------------------------------------------- 1 | ; Quotient of n arguments 2 | (define div 3 | (macro args 4 | (forget 'div) 5 | `(n-ary div _div 1 ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/eql.l: -------------------------------------------------------------------------------- 1 | ; Equivalence 2 | (define eql 3 | (macro (x y) 4 | 5 | (forget 'eql) 6 | 7 | (define _eql 8 | (lambda (x y) 9 | (if (and (numberp x) (numberp y)) 10 | (= x y) 11 | (eq x y)))) 12 | 13 | `(',_eql ,x ,y))) 14 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/equal.l: -------------------------------------------------------------------------------- 1 | ; Equality of n arguments 2 | (define equal 3 | (macro args 4 | (forget 'equal) 5 | `(order-nary equal _equal ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/explode.l: -------------------------------------------------------------------------------- 1 | ; Explode a symbol into a list of one character symbols 2 | (define explode 3 | (lambda (s) 4 | 5 | (if (not (symbolp s)) 6 | (error '"? Argument to \"explode\" must be a symbol")) 7 | 8 | (if (eq s '"") 9 | '() 10 | (cons (car s) (explode (cdr s)))))) 11 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/for.l: -------------------------------------------------------------------------------- 1 | ; 'for' implementation 2 | (define for 3 | (macro (var list . body) 4 | 5 | (forget 'for) 6 | 7 | (define inner (gensym)) 8 | (define kbreak (gensym)) 9 | (define kcontinue (gensym)) 10 | (define nlist (gensym)) 11 | 12 | `(call/cc 13 | (lambda (,kbreak) 14 | 15 | (define break (macro () `(,kbreak '()))) 16 | (define continue (macro () `(,kcontinue ,kcontinue))) 17 | 18 | (define ,inner 19 | (lambda (,kcontinue) 20 | (if ,nlist 21 | (progn 22 | (setq ,var (car ,nlist)) 23 | ,@body 24 | (setq ,nlist (cdr ,nlist)) 25 | (,inner ,kcontinue))))) 26 | 27 | (define ,var) 28 | (define ,nlist ,list) 29 | (,inner (call/cc (lambda (k) k))))))) 30 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/global.l: -------------------------------------------------------------------------------- 1 | ; 'global' binds and assigns in the top environment 2 | ; (won't work if a local variable shadows the global variable) 3 | (define global 4 | (macro (var . val) 5 | (forget 'global) 6 | 7 | (if val 8 | `(progn (eval '(define ,var) *topk*) (setq ,var ,@val)) 9 | `(eval '(define ,var) *topk*)))) 10 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/greater.l: -------------------------------------------------------------------------------- 1 | ; Descending order of n arguments 2 | (define greater 3 | (macro args 4 | (forget 'greater) 5 | `(order-nary greater _greater ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/greaterorequal.l: -------------------------------------------------------------------------------- 1 | ; Monotonic descending order of n arguments 2 | (define greaterorequal 3 | (macro args 4 | (forget 'greaterorequal) 5 | `(order-nary greaterorequal _greaterorequal ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/iand.l: -------------------------------------------------------------------------------- 1 | ; Integer and of n arguments 2 | (define iand 3 | (macro args 4 | (forget 'iand) 5 | `(n-ary iand _iand -1 ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/implode.l: -------------------------------------------------------------------------------- 1 | ; Implode a list of (one or more character) symbols into a single symbol 2 | (define implode 3 | (lambda (l) 4 | 5 | (if (not (listp l)) 6 | (error '"? Argument to \"implode\" must be a list")) 7 | 8 | (if (not l) 9 | '"" 10 | (cats (car l) (implode (cdr l)))))) 11 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/ior.l: -------------------------------------------------------------------------------- 1 | ; Integer or of n arguments 2 | (define ior 3 | (macro args 4 | (forget 'ior) 5 | `(n-ary ior _ior 0 ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/ixor.l: -------------------------------------------------------------------------------- 1 | ; Integer xor of n arguments 2 | (define ixor 3 | (macro args 4 | (forget 'ixor) 5 | `(n-ary ixor _ixor 0 ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/length.l: -------------------------------------------------------------------------------- 1 | ; List length 2 | (define length 3 | (macro (l) 4 | 5 | (forget 'length) 6 | 7 | (define _length 8 | (lambda (l) 9 | 10 | (if (not l) 11 | 0 12 | (progn 13 | (if (atom l) 14 | (error '"? Argument to \"length\" must be a list")) 15 | (+ 1 (_length (cdr l))))))) 16 | 17 | `(',_length ,l))) 18 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/less.l: -------------------------------------------------------------------------------- 1 | ; Ascending order of n arguments 2 | (define less 3 | (macro args 4 | (forget 'less) 5 | `(order-nary less _less ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/lessorequal.l: -------------------------------------------------------------------------------- 1 | ; Monotonic ascending order of n arguments 2 | (define lessorequal 3 | (macro args 4 | (forget 'lessorequal) 5 | `(order-nary lessorequal _lessorequal ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/let.l: -------------------------------------------------------------------------------- 1 | ; 'let' using lambda, bind all at once 2 | (define let 3 | (macro (bind . body) 4 | 5 | (forget 'let) 6 | 7 | (define vars 8 | (lambda (b) 9 | (if (not b) 10 | '() 11 | (cons (caar b) (vars (cdr b)))))) 12 | 13 | (define vals 14 | (lambda (b) 15 | (if (not b) 16 | '() 17 | (cons (cadar b) (vals (cdr b)))))) 18 | 19 | `((lambda ,(vars bind) ,@body) ,@(vals bind)))) 20 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/lets.l: -------------------------------------------------------------------------------- 1 | ; 'lets' using nested lambdas, sequential binding 2 | (define lets 3 | (macro (bind . body) 4 | 5 | (forget 'lets) 6 | 7 | (define bind1 8 | (lambda (bind body) 9 | (if (not bind) 10 | `(progn ,@body) 11 | `((lambda ,(list (caar bind)) 12 | ,(bind1 (cdr bind) body)) ,(cadar bind))))) 13 | 14 | (bind1 bind body))) 15 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/listp.l: -------------------------------------------------------------------------------- 1 | ; List predicate 2 | (define listp 3 | (macro (x) 4 | (forget 'listp) 5 | `(or (null ,x) (pairp ,x)))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/mapcar.l: -------------------------------------------------------------------------------- 1 | ; Apply f to each element in l, return list of results 2 | (define mapcar 3 | (lambda (f l) 4 | (if (not l) 5 | '() 6 | (cons (f (car l)) (mapcar f (cdr l)))))) 7 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/mul.l: -------------------------------------------------------------------------------- 1 | ; Product of n arguments 2 | (define mul 3 | (macro args 4 | (forget 'mul) 5 | `(n-ary mul _mul 1 ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/n-ary.l: -------------------------------------------------------------------------------- 1 | ; Extend a 2 argument function to an arbitrary number of arguments 2 | (define n-ary 3 | 4 | ; args: macro name, primitive function, base value, argument list 5 | (macro (mnam pfun bval . args) 6 | 7 | (forget 'n-ary) 8 | 9 | (define first (car args)) 10 | (define second (cadr args)) 11 | (define more (cddr args)) 12 | 13 | (if (not first) 14 | bval 15 | (if (not second) 16 | `(,pfun ,bval ,first) 17 | (if (not more) 18 | `(,pfun ,first ,second) 19 | `(,mnam (,pfun ,first ,second) ,@more)))))) 20 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/nlprint.l: -------------------------------------------------------------------------------- 1 | ; Print expression followed by "\n" 2 | (define nlprint 3 | (lambda args 4 | (if (if args (not (cddr args))) 5 | (progn 6 | (define d (defer 't)) 7 | (if (cdr args) 8 | (print (car args) (cadr args)) 9 | (print (car args))) 10 | (print '\n) 11 | (defer d) 12 | '"") 13 | (error '"? nlprint expects one or two arguments")))) 14 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/nth.l: -------------------------------------------------------------------------------- 1 | ; Reference nth item in list 2 | (define nth 3 | (macro (n l) 4 | 5 | (forget 'nth) 6 | 7 | (define _nth 8 | (lambda (n l) 9 | 10 | (if (or (not (integerp n)) (< n 0)) 11 | (error '"? First argument to \"nth\" must be a positive integer")) 12 | (if (not (listp l)) 13 | (error '"? Second argument to \"nth\" must be a list")) 14 | 15 | (if (zerop n) 16 | (car l) 17 | (_nth (- n 1) (cdr l))))) 18 | 19 | `(',_nth ,n ,l))) 20 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/null.l: -------------------------------------------------------------------------------- 1 | ; Null (empty) list predicate - same as 'not' 2 | (define null 3 | (macro (x) 4 | (forget 'null) 5 | `(not ,x))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/numberp.l: -------------------------------------------------------------------------------- 1 | ; Number predicate 2 | (define numberp 3 | (macro (x) 4 | (forget 'numberp) 5 | `(or (integerp ,x) (realp ,x)))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/or.l: -------------------------------------------------------------------------------- 1 | ; Logical, short-circuiting or of n arguments 2 | (define or 3 | (macro args 4 | (forget 'or) 5 | `(n-ary or _lor '() ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/order-nary.l: -------------------------------------------------------------------------------- 1 | ; Extend a 2 argument numeric ordering to an arbitrary number of arguments 2 | (define order-nary 3 | 4 | ; args: macro name, primitive function, argument list 5 | (macro (mnam pfun . args) 6 | 7 | (forget 'order-nary) 8 | 9 | (define first (car args)) 10 | (define second (cadr args)) 11 | (define more (cddr args)) 12 | 13 | (if (not first) 14 | `'t 15 | (if (not second) 16 | 17 | `(progn 18 | (if (not (numberp ,first)) 19 | (error 20 | (cats '"? Arguments to '" ',mnam '"' must be numbers")) 21 | 't)) 22 | 23 | (if (not more) 24 | `(,pfun ,first ,second) 25 | `(if (,pfun ,first ,second) 26 | (,mnam ,second ,@more))))))) 27 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/reverse.l: -------------------------------------------------------------------------------- 1 | ; Reverse a list 2 | (define reverse 3 | (macro (l) 4 | 5 | (forget 'reverse) 6 | 7 | (define _reverser 8 | (lambda (fwd rev) 9 | 10 | (if (not (listp fwd)) 11 | (error '"? Argument to \"reverse\" must be a list")) 12 | 13 | (if (not fwd) 14 | rev 15 | (_reverser (cdr fwd) (cons (car fwd) rev))))) 16 | 17 | `(',_reverser ,l '()))) 18 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/sub.l: -------------------------------------------------------------------------------- 1 | ; Difference of n arguments 2 | (define sub 3 | (macro args 4 | (forget 'sub) 5 | `(n-ary sub _sub 0 ,@args))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/switch.l: -------------------------------------------------------------------------------- 1 | ; switch statement implementation 2 | (define switch 3 | (macro (swexpr . cases) 4 | 5 | (forget 'switch) 6 | 7 | (define kbreak (gensym)) 8 | (define keyval (gensym)) 9 | (define match (gensym)) 10 | 11 | (define _eql 12 | (lambda (x y) 13 | (if (and (numberp x) (numberp y)) 14 | (= x y) 15 | (eq x y)))) 16 | 17 | (define vmult 18 | (lambda (acase) 19 | (if (not (caar acase)) 20 | '() 21 | (cons (cons (caar acase) (cdr acase)) 22 | (vmult (cons (cdar acase) (cdr acase))))))) 23 | 24 | (define case-test 25 | (lambda (acase) 26 | (if (eq (car acase) 'default) 27 | `(progn ,@(cdr acase)) 28 | `(if (or ,match (',_eql ,keyval ',(car acase))) 29 | (progn (setq ,match 't) ,@(cdr acase)))))) 30 | 31 | (define tests 32 | (lambda (cases) 33 | (if (not cases) 34 | '() 35 | (if (pairp (caar cases)) 36 | (append (tests (vmult (car cases))) (tests (cdr cases))) 37 | (cons (case-test (car cases)) (tests (cdr cases))))))) 38 | 39 | `(call/cc 40 | (lambda (,kbreak) 41 | (define ,match '()) 42 | (define ,keyval ,swexpr) 43 | (define break (macro () `(,kbreak '()))) 44 | ,@(tests cases))))) 45 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/vector.l: -------------------------------------------------------------------------------- 1 | ; Create a vector from arguments 2 | (define vector 3 | (macro x 4 | (forget 'vector) 5 | `(list2vector (list ,@x)))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/vector2list.l: -------------------------------------------------------------------------------- 1 | ; Vector to list 2 | (define vector2list 3 | (macro (v) 4 | 5 | (forget 'vector2list) 6 | 7 | (define _v2l 8 | (lambda (i v) 9 | 10 | (if (not (vectorp v)) 11 | (error '"? Argument to \"vector2list\" must be a vector")) 12 | 13 | (define n (vlen v)) 14 | (if (not (< i n)) 15 | '() 16 | (cons (vref v i) (_v2l (+ i 1) v))))) 17 | 18 | `(',_v2l 0 ,v))) 19 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/lang/while.l: -------------------------------------------------------------------------------- 1 | ; 'while' implementation 2 | (define while 3 | (macro (condition . body) 4 | 5 | (forget 'while) 6 | 7 | (define inner (gensym)) 8 | (define kbreak (gensym)) 9 | (define kcontinue (gensym)) 10 | 11 | `(call/cc 12 | (lambda (,kbreak) 13 | 14 | (define break (macro () `(,kbreak '()))) 15 | (define continue (macro () `(,kcontinue ,kcontinue))) 16 | 17 | (define ,inner 18 | (lambda (,kcontinue) 19 | (if ,condition (progn ,@body (,inner ,kcontinue))))) 20 | 21 | (,inner (call/cc (lambda (k) k))))))) 22 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/author.l: -------------------------------------------------------------------------------- 1 | (define author 2 | (macro () 3 | (forget 'author) 4 | `'"Luther Johnson, 330 N. Comanche Dr. #20, Chandler, AZ 85224\n")) 5 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/autoload.l: -------------------------------------------------------------------------------- 1 | ; Load on demand support 2 | (if (boundp '_AUTOLOAD_L_) (eof) (define _AUTOLOAD_L_)) 3 | 4 | (include ') 5 | 6 | ; call/cc, with a guaranteed new continuation to hold current environment 7 | (define call/ce 8 | (macro (f) 9 | `(let ((v (call/cc ,f))) v))) 10 | 11 | ; Autoload evaluates in the top environment 12 | (define autoload 13 | (lambda (x) 14 | 15 | (define _load 16 | (lambda (k) 17 | 18 | (define *error-continue* k) 19 | (define reval 20 | (lambda () 21 | (if (_equal l (inclevel)) 22 | '() 23 | (progn 24 | (eval (read) *topk*) 25 | (reval))))) 26 | 27 | (define l (inclevel)) 28 | (include x) 29 | (reval) 30 | '())) 31 | 32 | (if (define e (call/cc _load)) (error e)))) 33 | 34 | ; Load a lambda or macro definition and apply it 35 | (define loadapply 36 | (macro (file func . args) 37 | (autoload file) 38 | `(,func ,@args))) 39 | 40 | ; Capture top continuation 41 | (call/cc 42 | (lambda (k) 43 | (eval `(define *topk* ',k) k))) 44 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/debug.l: -------------------------------------------------------------------------------- 1 | ; Set a breakpoint on a function 2 | (define debug 3 | (macro (f) 4 | (forget 'debug) 5 | 6 | (define _debug 7 | (lambda (k) 8 | 9 | ; Loader which catches errors 10 | (define loadfun 11 | (lambda (kload) 12 | (define df (defer 't)) 13 | (global "*error-continue*" kload) 14 | (defer df) 15 | (define fobj (eval f k)) 16 | (if (eq (car fobj) (car (macro ()))) 17 | (load (cats f '".l") k)))) 18 | 19 | ; Attempt to load function if necessary 20 | (define old-error-handler 21 | (if (assignedp '"*error-continue*") "*error-continue*")) 22 | (call/cc loadfun) 23 | (define df (defer 't)) 24 | (global "*error-continue*" old-error-handler) 25 | (defer df) 26 | 27 | ; Macro ? 28 | (define fobj (eval f k)) 29 | (if (eq (car fobj) (car (macro ()))) 30 | (error (cats '"? Can't set breakpoint on macro '" f '"'"))) 31 | 32 | ; Already being debugged ? 33 | (if (eq (car debugger) (caaddr fobj)) 34 | fobj 35 | 36 | ; Debugger primitive wraps body 37 | (progn 38 | (define newf 39 | (list (car fobj) (cadr fobj) 40 | (append (list (car debugger) f) (cddr fobj)))) 41 | (eval `(define ,f ',newf) k))))) 42 | 43 | `(call/cc ',_debug))) 44 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/discard.l: -------------------------------------------------------------------------------- 1 | ; Discard value 2 | (define discard 3 | (macro (x) 4 | (forget 'discard) 5 | `((lambda (x) '"") ,x))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/expand.l: -------------------------------------------------------------------------------- 1 | ; Macro which expands all macro applications in an expression 2 | (define expand 3 | (macro (x) 4 | (forget 'expand) 5 | `',(flatten x))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/flatten.l: -------------------------------------------------------------------------------- 1 | ; Function which expands all macro applications in an expression 2 | (define flatten 3 | (lambda (x) 4 | 5 | (define cexpand 6 | (lambda (k) 7 | 8 | (define listquote 9 | (lambda (l) 10 | (if (not l) 11 | '() 12 | (cons (list 'quote (car l)) (listquote (cdr l)))))) 13 | 14 | (define listexpand 15 | (lambda (l) 16 | (if (not l) 17 | '() 18 | (cons (flatten (car l)) (listexpand (cdr l)))))) 19 | 20 | (define xprest 21 | (lambda () 22 | (cons (car x) (listexpand (cdr x))))) 23 | 24 | (if (not (pairp x)) (k x)) 25 | (define y (car x)) 26 | 27 | (if (eq y 'lambda) (k x)) 28 | (if (eq y 'macro) (k x)) 29 | 30 | (if (not (symbolp y)) (k (xprest))) 31 | (if (not (assignedp y)) (k (xprest))) 32 | (define z (eval y)) 33 | 34 | (if (not (pairp z)) (k (xprest))) 35 | (if (not (eq (car z) (car (macro ())))) (k (xprest))) 36 | 37 | (flatten (eval `(',z ,@(listquote (listexpand (cdr x)))))))) 38 | 39 | (call/cc cexpand))) 40 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/import.l: -------------------------------------------------------------------------------- 1 | ; Import a function, lambda, or macro 2 | (define import 3 | (macro (f) 4 | (forget 'import) 5 | (define file (cats f '".l")) 6 | `(global ,f (macro args `(loadapply ,file ,f ,',@args))))) 7 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/isloaded.l: -------------------------------------------------------------------------------- 1 | ; Is this symbol reachable at the current or specified level or higher, and assigned ? 2 | (define isloaded 3 | (macro args 4 | 5 | (define _isloaded 6 | (lambda (s keval) 7 | 8 | (if (not (symbolp s)) 9 | (error '"? \"isloaded\" expects symbol as first argument")) 10 | 11 | (define old-autoload 12 | (eval `(if (assignedp '"*don't-autoload*") "*don't-autoload*") keval)) 13 | (eval `(define "*don't-autoload*" 't) keval) 14 | (define there (eval `(boundp ',s) keval)) 15 | (eval `(define "*don't-autoload*" ',old-autoload) keval) 16 | there)) 17 | 18 | (if (cdr args) 19 | `(',_isloaded ,(car args) ,(cadr args)) 20 | `(call/ce (lambda (k) (',_isloaded ,(car args) k)))))) 21 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/load.l: -------------------------------------------------------------------------------- 1 | ; Manual load 2 | 3 | ; Read and evaluate all expressions in current or specified environment 4 | (define load 5 | (macro args 6 | 7 | (define _load1 8 | (lambda (x keval) 9 | 10 | (define _load2 11 | (lambda (k) 12 | 13 | (define *error-continue* k) 14 | (define reval 15 | (lambda () 16 | (if (_equal l (inclevel)) 17 | '() 18 | (progn 19 | (eval (read) keval) 20 | (reval))))) 21 | 22 | (define l (inclevel)) 23 | (include x) 24 | (reval) 25 | '())) 26 | 27 | (if (define e (call/cc _load2)) 28 | (error e) 29 | '""))) 30 | 31 | (if (cdr args) 32 | `(',_load1 ,(car args) ,(car (cdr args))) 33 | `(call/ce (lambda (k) (',_load1 ,(car args) k)))))) 34 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/makerlisp.l: -------------------------------------------------------------------------------- 1 | ; MakerLisp start-up file 2 | (if (boundp '_MAKERLISP_L_) (eof) (define _MAKERLISP_L_)) 3 | 4 | ; Arithmetic aliases are not good filenames 5 | (include ') 6 | 7 | ; All other 'built-in' code is auto-loaded 8 | (include ') 9 | 10 | ; User start-up 11 | (include ') 12 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/nopatch.l: -------------------------------------------------------------------------------- 1 | ; Turn off patching of VM command expansions 2 | (define nopatch 3 | (macro () 4 | (forget 'nopatch) 5 | `(global "*don't-patch*" 't))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/patchon.l: -------------------------------------------------------------------------------- 1 | ; Turn on patching of VM command expansions 2 | (define patchon 3 | (macro () 4 | (forget 'patchon) 5 | `(global "*don't-patch*" '()))) 6 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/path.l: -------------------------------------------------------------------------------- 1 | ; Get/set a list of symbols from/to, the *PATH* variable 2 | (define path 3 | (lambda args 4 | 5 | (if (not args) 6 | 7 | ; No arguments, get the path as a list of symbols 8 | (progn 9 | 10 | (define tpath *PATH*) 11 | (define c) 12 | 13 | (if (not (symbolp tpath)) 14 | (error '"? *PATH* must be a symbol")) 15 | 16 | ; Pull the first symbol off the path 17 | (define firstsym 18 | (lambda (first) 19 | (setq c (car tpath)) 20 | (setq tpath (cdr tpath)) 21 | (if (or (eq c '"") (eq c '":")) 22 | first 23 | (firstsym (cats first c))))) 24 | 25 | ; Build up the list of symbols 26 | (define getpath 27 | (lambda () 28 | (if (eq tpath '"") 29 | '() 30 | (let ((first (firstsym '""))) 31 | (cons first (getpath)))))) 32 | 33 | (getpath)) 34 | 35 | ; Or one argument, set the path from a list of symbols 36 | (progn 37 | 38 | (if (or (cdr args) (not (listp (car args)))) 39 | (error '"? Argument to \"path\" must be a list")) 40 | 41 | ; Walk list concatenating symbols 42 | (define setpath 43 | (lambda (l tpath) 44 | (if (not l) 45 | tpath 46 | (let ((s (car l))) 47 | (if (not (symbolp s)) 48 | (error '"? Argument to \"path\" must be list of symbols")) 49 | (setq tpath (cats tpath s)) 50 | (if (cdr l) 51 | (setq tpath (cats tpath '":"))) 52 | (setpath (cdr l) tpath))))) 53 | 54 | (global *PATH* (setpath (car args) '"")))))) 55 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/repl.l: -------------------------------------------------------------------------------- 1 | ; Second-level read-eval-print loop 2 | (define repl 3 | (lambda announce 4 | 5 | ; Loop until end of input 6 | (define _repl 7 | (lambda (krepl) 8 | 9 | (define e) 10 | (define r) 11 | (define v) 12 | 13 | (define getexpr 14 | (lambda (k) 15 | (define df (defer 't)) 16 | (global "*error-continue*" k) 17 | (defer df) 18 | (setq r (read '">>> ")) 19 | '())) 20 | 21 | (define evaluate 22 | (lambda (k) 23 | (define df (defer 't)) 24 | (global "*error-continue*" k) 25 | (defer df) 26 | (eval r krepl))) 27 | 28 | (eval `(define exit (lambda (n) (',krepl n))) krepl) 29 | 30 | (while 't 31 | 32 | (if (setq e (call/cc getexpr)) 33 | (setq r (list 'quote e)) 34 | (progn 35 | (if (eq r '"") (progn (nlprint '"") (continue))) 36 | (if (eq r '"^D") (break)))) 37 | 38 | (setq v (call/cc evaluate)) 39 | (if (eq v '"") (continue)) 40 | 41 | (nlprint v)))) 42 | 43 | ; Start the repl with a continuation holding its environment 44 | (if announce (nlprint (car announce))) 45 | (define old-error-continue (if (assignedp '"*error-continue*") "*error-continue*")) 46 | (call/ce _repl) 47 | (define df (defer 't)) 48 | (global "*error-continue*" old-error-continue) 49 | (defer df) 50 | '"")) 51 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/undebug.l: -------------------------------------------------------------------------------- 1 | ; Remove a breakpoint on a function 2 | (define undebug 3 | (macro (f) 4 | (forget 'undebug) 5 | 6 | (define _undebug 7 | (lambda (k) 8 | 9 | ; Macro ? 10 | (define fobj (eval f k)) 11 | (if (eq (car fobj) (car (macro ()))) 12 | (error (cats '"? No breakpoint on macro '" f '"'"))) 13 | 14 | ; Not being debugged ? 15 | (if (not (eq (car debugger) (caaddr fobj))) 16 | fobj 17 | 18 | ; Extract body from debugger wrapping 19 | (progn 20 | (define oldb (cddr (caddr fobj))) 21 | (rplacd (cdr fobj) oldb) 22 | fobj)))) 23 | 24 | `(call/cc ',_undebug))) 25 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/unload.l: -------------------------------------------------------------------------------- 1 | ; Forget a loaded function or macro 2 | (define unload 3 | (lambda (x) 4 | 5 | (if (not (symbolp x)) 6 | (error '"? \"unload\" expects one symbol as argument")) 7 | 8 | (define "*allow-forget*" 't) 9 | (forget x))) 10 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/untrace.l: -------------------------------------------------------------------------------- 1 | ; Un-trace object, restore original assignment 2 | (define untrace 3 | (macro (fnam) 4 | 5 | (forget 'untrace) 6 | 7 | (define oldval 8 | (lambda (otraced fnam) 9 | (if (not otraced) 10 | (error '"? untrace: object not traced") 11 | (if (eq (car (car otraced)) fnam) 12 | (cdr (car otraced)) 13 | (oldval (cdr otraced) fnam))))) 14 | 15 | (define newtrace 16 | (lambda (otraced fnam) 17 | (if (not otraced) 18 | '() 19 | (if (eq (car (car otraced)) fnam) 20 | (cdr otraced) 21 | (cons (car otraced) (newtrace (cdr otraced) fnam)))))) 22 | 23 | (if (not (assignedp '*traced-objects*)) 24 | (error '"? untrace: no objects traced")) 25 | 26 | `(progn 27 | (setq ,fnam (',oldval *traced-objects* ',fnam)) 28 | (setq *traced-objects* (',newtrace *traced-objects* ',fnam)) 29 | ,fnam))) 30 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/user.l: -------------------------------------------------------------------------------- 1 | ; User start-up 2 | 3 | ; Set path 4 | (define *PATH* '"/demo:/bin") 5 | 6 | ; Announce 7 | (nlprint (version)) 8 | -------------------------------------------------------------------------------- /src/uSDimage/lisp/l/util/version.l: -------------------------------------------------------------------------------- 1 | ; Version 2 | (define version 3 | (macro () 4 | (forget 'version) 5 | `'"MakerLisp Version 1.4")) 6 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/apps/usb/host/hid_keyboard/firmware/demo_src/system_config.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright 2016 Microchip Technology Inc. (www.microchip.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | To request to license the code under the MLA license (www.microchip.com/mla_license), 17 | please contact mla_licensing@microchip.com 18 | *******************************************************************************/ 19 | 20 | #include "usb_config.h" 21 | 22 | #define TIMER_MAX_1MS_CLIENTS 2 -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/apps/usb/host/hid_keyboard/firmware/exp16_pic32mm0256gpm064_pim.x/io_mapping.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Software License Agreement: 3 | 4 | The software supplied herewith by Microchip Technology Incorporated 5 | (the "Company") for its PIC(R) Microcontroller is intended and 6 | supplied to you, the Company's customer, for use solely and 7 | exclusively on Microchip PIC Microcontroller products. The 8 | software is owned by the Company and/or its supplier, and is 9 | protected under applicable copyright laws. All rights are reserved. 10 | Any use in violation of the foregoing restrictions may subject the 11 | user to criminal sanctions under applicable laws, as well as to 12 | civil liability for the breach of the terms and conditions of this 13 | license. 14 | 15 | THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES, 16 | WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED 17 | TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, 19 | IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR 20 | CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. 21 | *******************************************************************/ 22 | #include "leds.h" 23 | 24 | #define LED_USB_HOST_HID_KEYBOARD_DEVICE_READY LED_D3 25 | #define LED_USB_HOST_HID_KEYBOARD_CAPS_LOCK LED_D5 26 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/apps/usb/host/hid_keyboard/firmware/exp16_pic32mm0256gpm064_pim.x/nbproject/Makefile-genesis.properties: -------------------------------------------------------------------------------- 1 | # 2 | #Wed Jun 12 23:44:21 MST 2019 3 | PIC32MM0256GPM064_PIM.com-microchip-mplab-nbide-toolchainXC32-XC32LanguageToolchain.md5=fcf9db1a3d46b4ef4e0a46afcbf02251 4 | PIC32MM0256GPM064_PIM.languagetoolchain.dir=c\:\\Users\\luther\\nclb\\tools\\microchip\\windows\\xc32\\v1.44\\bin 5 | PIC32MM0256GPM064_PIM.languagetoolchain.version=1.44 6 | configurations-xml=b6f2b3b724202896eec48b86bf7d55bd 7 | com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=c8c2915d32f5d7e4be49831bc9827ab0 8 | host.platform=windows 9 | conf.ids=PIC32MM0256GPM064_PIM 10 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/apps/usb/host/hid_keyboard/firmware/exp16_pic32mm0256gpm064_pim.x/nbproject/Makefile-variables.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Generated - do not edit! 3 | # 4 | # NOCDDL 5 | # 6 | CND_BASEDIR=`pwd` 7 | # PIC32MM0256GPM064_PIM configuration 8 | CND_ARTIFACT_DIR_PIC32MM0256GPM064_PIM=dist/PIC32MM0256GPM064_PIM/production 9 | CND_ARTIFACT_NAME_PIC32MM0256GPM064_PIM=exp16_pic32mm0256gpm064_pim.x.production.hex 10 | CND_ARTIFACT_PATH_PIC32MM0256GPM064_PIM=dist/PIC32MM0256GPM064_PIM/production/exp16_pic32mm0256gpm064_pim.x.production.hex 11 | CND_PACKAGE_DIR_PIC32MM0256GPM064_PIM=${CND_DISTDIR}/PIC32MM0256GPM064_PIM/package 12 | CND_PACKAGE_NAME_PIC32MM0256GPM064_PIM=exp16pic32mm0256gpm064pim.x.tar 13 | CND_PACKAGE_PATH_PIC32MM0256GPM064_PIM=${CND_DISTDIR}/PIC32MM0256GPM064_PIM/package/exp16pic32mm0256gpm064pim.x.tar 14 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/apps/usb/host/hid_keyboard/firmware/exp16_pic32mm0256gpm064_pim.x/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.microchip.mplab.nbide.embedded.makeproject 4 | 5 | 6 | USB Host - HID - Keyboard 7 | 0 8 | c 9 | 10 | h 11 | UTF-8 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/apps/usb/host/hid_keyboard/firmware/mlm_usb_host.x/io_mapping.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Software License Agreement: 3 | 4 | The software supplied herewith by Microchip Technology Incorporated 5 | (the "Company") for its PIC(R) Microcontroller is intended and 6 | supplied to you, the Company's customer, for use solely and 7 | exclusively on Microchip PIC Microcontroller products. The 8 | software is owned by the Company and/or its supplier, and is 9 | protected under applicable copyright laws. All rights are reserved. 10 | Any use in violation of the foregoing restrictions may subject the 11 | user to criminal sanctions under applicable laws, as well as to 12 | civil liability for the breach of the terms and conditions of this 13 | license. 14 | 15 | THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES, 16 | WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED 17 | TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, 19 | IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR 20 | CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. 21 | *******************************************************************/ 22 | #include "leds.h" 23 | 24 | #define LED_USB_HOST_HID_KEYBOARD_DEVICE_READY LED_D2 25 | #define LED_USB_HOST_HID_KEYBOARD_CAPS_LOCK LED_NONE 26 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/apps/usb/host/hid_keyboard/firmware/mlm_usb_host.x/nbproject/Makefile-genesis.properties: -------------------------------------------------------------------------------- 1 | # 2 | #Fri Jun 28 17:27:05 MST 2019 3 | MLM_USB_Host.languagetoolchain.dir=c\:\\Users\\luther\\nclb\\tools\\microchip\\windows\\xc32\\v1.44\\bin 4 | MLM_USB_Host.languagetoolchain.version=1.44 5 | MLM_USB_Host.com-microchip-mplab-nbide-toolchainXC32-XC32LanguageToolchain.md5=fcf9db1a3d46b4ef4e0a46afcbf02251 6 | configurations-xml=c2b4184ff607757d516f2760338f527e 7 | com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=c8c2915d32f5d7e4be49831bc9827ab0 8 | host.platform=windows 9 | conf.ids=MLM_USB_Host 10 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/apps/usb/host/hid_keyboard/firmware/mlm_usb_host.x/nbproject/Makefile-variables.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Generated - do not edit! 3 | # 4 | # NOCDDL 5 | # 6 | CND_BASEDIR=`pwd` 7 | # MLM_USB_Host configuration 8 | CND_ARTIFACT_DIR_MLM_USB_Host=dist/MLM_USB_Host/production 9 | CND_ARTIFACT_NAME_MLM_USB_Host=mlm_usb_host.x.production.hex 10 | CND_ARTIFACT_PATH_MLM_USB_Host=dist/MLM_USB_Host/production/mlm_usb_host.x.production.hex 11 | CND_PACKAGE_DIR_MLM_USB_Host=${CND_DISTDIR}/MLM_USB_Host/package 12 | CND_PACKAGE_NAME_MLM_USB_Host=mlmusbhost.x.tar 13 | CND_PACKAGE_PATH_MLM_USB_Host=${CND_DISTDIR}/MLM_USB_Host/package/mlmusbhost.x.tar 14 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/apps/usb/host/hid_keyboard/firmware/mlm_usb_host.x/nbproject/Package-MLM_USB_Host.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | # 4 | # Generated - do not edit! 5 | # 6 | 7 | # Macros 8 | TOP=`pwd` 9 | CND_CONF=MLM_USB_Host 10 | CND_DISTDIR=dist 11 | TMPDIR=build/${CND_CONF}/${IMAGE_TYPE}/tmp-packaging 12 | TMPDIRNAME=tmp-packaging 13 | OUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/mlm_usb_host.x.${IMAGE_TYPE}.${OUTPUT_SUFFIX} 14 | OUTPUT_BASENAME=mlm_usb_host.x.${IMAGE_TYPE}.${OUTPUT_SUFFIX} 15 | PACKAGE_TOP_DIR=mlmusbhost.x/ 16 | 17 | # Functions 18 | function checkReturnCode 19 | { 20 | rc=$? 21 | if [ $rc != 0 ] 22 | then 23 | exit $rc 24 | fi 25 | } 26 | function makeDirectory 27 | # $1 directory path 28 | # $2 permission (optional) 29 | { 30 | mkdir -p "$1" 31 | checkReturnCode 32 | if [ "$2" != "" ] 33 | then 34 | chmod $2 "$1" 35 | checkReturnCode 36 | fi 37 | } 38 | function copyFileToTmpDir 39 | # $1 from-file path 40 | # $2 to-file path 41 | # $3 permission 42 | { 43 | cp "$1" "$2" 44 | checkReturnCode 45 | if [ "$3" != "" ] 46 | then 47 | chmod $3 "$2" 48 | checkReturnCode 49 | fi 50 | } 51 | 52 | # Setup 53 | cd "${TOP}" 54 | mkdir -p ${CND_DISTDIR}/${CND_CONF}/package 55 | rm -rf ${TMPDIR} 56 | mkdir -p ${TMPDIR} 57 | 58 | # Copy files and create directories and links 59 | cd "${TOP}" 60 | makeDirectory ${TMPDIR}/mlmusbhost.x/bin 61 | copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 62 | 63 | 64 | # Generate tar file 65 | cd "${TOP}" 66 | rm -f ${CND_DISTDIR}/${CND_CONF}/package/mlmusbhost.x.tar 67 | cd ${TMPDIR} 68 | tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/mlmusbhost.x.tar * 69 | checkReturnCode 70 | 71 | # Cleanup 72 | cd "${TOP}" 73 | rm -rf ${TMPDIR} 74 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/apps/usb/host/hid_keyboard/firmware/mlm_usb_host.x/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.microchip.mplab.nbide.embedded.makeproject 4 | 5 | 6 | USB Host - HID - Keyboard 7 | 0 8 | c 9 | 10 | h 11 | UTF-8 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/bsp/exp16/pic32mm0256gpm064_pim/fwupd.h: -------------------------------------------------------------------------------- 1 | /* Firmware update routine */ 2 | #include 3 | 4 | extern __longramfunc__ void fwupd(); 5 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/bsp/mlm_usb_host/fwupd.h: -------------------------------------------------------------------------------- 1 | /* Firmware update routine */ 2 | #include 3 | 4 | extern __longramfunc__ void fwupd(); 5 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/framework/usb/doc/USB - Obtaining a WHQL Certified USB Driver Package.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/framework/usb/doc/USB - Obtaining a WHQL Certified USB Driver Package.pdf -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/framework/usb/doc/USB Driver Reseller Rights Request Form_030913.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/framework/usb/doc/USB Driver Reseller Rights Request Form_030913.doc -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/framework/usb/doc/help_mla_usb.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/framework/usb/doc/help_mla_usb.jar -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/framework/usb/doc/help_mla_usb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/framework/usb/doc/help_mla_usb.pdf -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Linux/32Bit/ReadMe_32Bit_Linux.txt: -------------------------------------------------------------------------------- 1 | ReadMe_32Bit_Linux.txt 2 | _____________________________________________________________________________ 3 | 4 | Most of the file placement below corresponds to MPLABComm use within MPLAB X. 5 | The libusb and libUSBAccessLink libraries should be accessible from outside 6 | of MPLAB X if placed in the /usr/lib/ subdirectory. 7 | 8 | Other files listed below deal with tool hotplug support. 9 | 10 | ----------------------------------------------------------------------------- 11 | File Placement (outside of MPLAB X) 12 | ----------------------------------------------------------------------------- 13 | Dir: File(s): Permissions: 14 | ----------------- ---------------------- ------------------- 15 | /usr/lib/ libUSBAccessLink.so -rwxr-xr-x 16 | 17 | /usr/lib/ libusb-1.0.so.0.0.0 -rwxr-xr-x 18 | libusb-1.0.a -rwxr-xr-x 19 | libusb-1.0.la -rwxr-xr-x 20 | 21 | /etc/.mplab_ide mchpdefport -rw-r--r-- 22 | mchplinusbdevice -rwxr-xr-x 23 | 24 | /etc/udev/rules.d z010_mchp_tools.rules -rw-r--r-- (requires reboot) 25 | 26 | ----------------------------------------------------------------------------- 27 | Create Soft Link(s): 28 | ----------------------------------------------------------------------------- 29 | 1) Link to libusb: 30 | 31 | $ cd /usr/lib 32 | $ sudo ln -s /usr/lib/libusb-1.0.so.0.0.0 libusb-1.0.so 33 | 34 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Linux/32Bit/mchpdefport: -------------------------------------------------------------------------------- 1 | localhost 2 | 30000 3 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Linux/32Bit/mchplinusbdevice: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Linux/32Bit/mchplinusbdevice -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Linux/32Bit/z010_mchp_tools.rules: -------------------------------------------------------------------------------- 1 | # PRJ 2010.01.26 Add reference to "usb" for Ubuntu. 2 | # PRJ 2010.01.22 Attempt to further simplify rules files requirements. 3 | # PRJ 2009.08.18 Rules file simplified. 4 | # PRJ 2009.07.15 Rules file created. 5 | 6 | ENV{hotplugscript}="/etc/.mplab_ide/mchplinusbdevice" 7 | 8 | ACTION!="add", GOTO="check_remove" 9 | SUBSYSTEM=="usb_device", GOTO="check_add" 10 | SUBSYSTEM!="usb", GOTO="rules_end" 11 | 12 | LABEL="check_add" 13 | 14 | SYSFS{idVendor}=="04d8", MODE="666", RUN+="%E{hotplugscript} add" 15 | GOTO="rules_end" 16 | 17 | LABEL="check_remove" 18 | 19 | ACTION=="remove", RUN+="%E{hotplugscript} remove %E{PRODUCT}" 20 | 21 | LABEL="rules_end" 22 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Linux/64Bit/ReadMe_64Bit_Linux.txt: -------------------------------------------------------------------------------- 1 | ReadMe_64Bit_Linux.txt 2 | _____________________________________________________________________________ 3 | 4 | Most of the file placement below corresponds to MPLABComm use within MPLAB X. 5 | The libusb and libUSBAccessLink libraries should be accessible from outside 6 | of MPLAB X if placed in the /usr/lib/ subdirectory. 7 | 8 | Other files listed below deal with tool hotplug support. 9 | 10 | ----------------------------------------------------------------------------- 11 | File Placement (outside of MPLAB X) 12 | ----------------------------------------------------------------------------- 13 | Dir: File(s): Permissions: 14 | ----------------- ---------------------- ------------------- 15 | /usr/lib/ libUSBAccessLink.so -rwxr-xr-x 16 | 17 | /usr/lib/ libusb-1.0.so.0.0.0 -rwxr-xr-x 18 | libusb-1.0.a -rwxr-xr-x 19 | libusb-1.0.la -rwxr-xr-x 20 | 21 | /etc/.mplab_ide mchpdefport -rw-r--r-- 22 | mchplinusbdevice -rwxr-xr-x 23 | 24 | /etc/udev/rules.d z010_mchp_tools.rules -rw-r--r-- (requires reboot) 25 | 26 | ----------------------------------------------------------------------------- 27 | Create Soft Link(s): 28 | ----------------------------------------------------------------------------- 29 | 1) Link to libusb: 30 | 31 | $ cd /usr/lib 32 | $ sudo ln -s /usr/lib/libusb-1.0.so.0.0.0 libusb-1.0.so 33 | 34 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Linux/64Bit/mchpdefport: -------------------------------------------------------------------------------- 1 | localhost 2 | 30000 3 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Linux/64Bit/mchplinusbdevice: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Linux/64Bit/mchplinusbdevice -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Linux/64Bit/z010_mchp_tools.rules: -------------------------------------------------------------------------------- 1 | # PRJ 2010.01.26 Add reference to "usb" for Ubuntu. 2 | # PRJ 2010.01.22 Attempt to further simplify rules files requirements. 3 | # PRJ 2009.08.18 Rules file simplified. 4 | # PRJ 2009.07.15 Rules file created. 5 | 6 | ENV{hotplugscript}="/etc/.mplab_ide/mchplinusbdevice" 7 | 8 | ACTION!="add", GOTO="check_remove" 9 | SUBSYSTEM=="usb_device", GOTO="check_add" 10 | SUBSYSTEM!="usb", GOTO="rules_end" 11 | 12 | LABEL="check_add" 13 | 14 | SYSFS{idVendor}=="04d8", MODE="666", RUN+="%E{hotplugscript} add" 15 | GOTO="rules_end" 16 | 17 | LABEL="check_remove" 18 | 19 | ACTION=="remove", RUN+="%E{hotplugscript} remove %E{PRODUCT}" 20 | 21 | LABEL="rules_end" 22 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.5/ReadMe_OSX_10.5.txt: -------------------------------------------------------------------------------- 1 | ReadMe_OSX_10.5.txt 2 | _____________________________________________________________________________ 3 | 4 | Dir: File: Permissions: 5 | --------------- -------------------------- ------------- 6 | /usr/lib/ libUSBAccessLink.dylib -rwxr-xr-x 7 | 8 | /usr/lib/java/ libUSBAccessLink.dylib -rwxr-xr-x 9 | 10 | /etc/.mplab_ide/ mchpdefport -rw-r--r-- 11 | 12 | ----------------------------------------------------------- 13 | 14 | If MPLAB X is NOT installed: 15 | Dir: File: Permissions: 16 | --------------- -------------------------- ------------- 17 | /etc/.mplab_ide/ mchpmacusbdevice -rwxr-xr-x 18 | 19 | /usr/lib/ libusb-1.0.0.dylib -rwxr-xr-x 20 | libusb-1.0.a -rwxr-xr-x 21 | libusb-1.0.la -rwxr-xr-x 22 | 23 | Create soft link as follows: 24 | $ cd /usr/lib 25 | $ sudo ln -s /usr/lib/libusb-1.0.0.dylib libusb-1.0.dylib 26 | 27 | ----------------------------------------------------------- 28 | 29 | If MPLAB X IS installed, libusb files will have been placed 30 | and soft links established appropriately (similar to those 31 | found on Linux systems). 32 | 33 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.5/libUSBAccessLink.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.5/libUSBAccessLink.dylib -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.5/libusb-1.0.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.5/libusb-1.0.0.dylib -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.5/mchpdefport: -------------------------------------------------------------------------------- 1 | localhost 30000 -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.5/mchpmacusbdevice: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.5/mchpmacusbdevice -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.6_And_Later/ReadMe_OSX_10.6.txt: -------------------------------------------------------------------------------- 1 | ReadMe_OSX_10.6.txt 2 | _____________________________________________________________________________ 3 | 4 | Dir: File: Permissions: 5 | --------------- -------------------------- ------------- 6 | /usr/lib/ libUSBAccessLink.dylib -rwxr-xr-x 7 | 8 | /usr/lib/java/ libUSBAccessLink.dylib -rwxr-xr-x 9 | 10 | /etc/.mplab_ide/ mchpdefport -rw-r--r-- 11 | 12 | ----------------------------------------------------------- 13 | 14 | If MPLAB X is NOT installed: 15 | Dir: File: Permissions: 16 | --------------- -------------------------- ------------- 17 | /etc/.mplab_ide/ mchpmacusbdevice -rwxr-xr-x 18 | 19 | /usr/lib/ libusb-1.0.0.dylib -rwxr-xr-x 20 | libusb-1.0.a -rwxr-xr-x 21 | libusb-1.0.la -rwxr-xr-x 22 | 23 | Create soft link as follows: 24 | $ cd /usr/lib 25 | $ sudo ln -s /usr/lib/libusb-1.0.0.dylib libusb-1.0.dylib 26 | 27 | ----------------------------------------------------------- 28 | 29 | If MPLAB X IS installed, libusb files will have been placed 30 | and soft links established appropriately (similar to those 31 | found on Linux systems). 32 | 33 | -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.6_And_Later/libUSBAccessLink.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.6_And_Later/libUSBAccessLink.dylib -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.6_And_Later/libusb-1.0.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.6_And_Later/libusb-1.0.0.dylib -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.6_And_Later/mchpdefport: -------------------------------------------------------------------------------- 1 | localhost 30000 -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.6_And_Later/mchpmacusbdevice: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/MacOSX/OSX_10.6_And_Later/mchpmacusbdevice -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/amd64/WUDFUpdate_01009.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/amd64/WUDFUpdate_01009.dll -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/amd64/WdfCoInstaller01009.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/amd64/WdfCoInstaller01009.dll -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/amd64/winusbcoinstaller2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/amd64/winusbcoinstaller2.dll -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/i386/WUDFUpdate_01009.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/i386/WUDFUpdate_01009.dll -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/i386/WdfCoInstaller01009.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/i386/WdfCoInstaller01009.dll -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/i386/winusbcoinstaller2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/i386/winusbcoinstaller2.dll -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/mplabcommwinusb.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/mplabcommwinusb.cat -------------------------------------------------------------------------------- /src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/zena adapter 2.4ghz mrf24j40.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/usbkey/mla_v2017_03_06/utilities/usb_drivers/mplab_comm/Windows/zena adapter 2.4ghz mrf24j40.cat -------------------------------------------------------------------------------- /src/vga/term720/core.con.system.spin: -------------------------------------------------------------------------------- 1 | '' 2 | '' prerequisites, dependencies & Co 3 | '' 4 | '' Author: Marko Lukat 5 | '' Last modified: 2011/10/22 6 | '' Version: 0.9 7 | '' 8 | CON 9 | _clkmode = XTAL1|PLL16X 10 | _xinfreq = 5_000_000 11 | 12 | CON 13 | ID_0 = $30B3309C 14 | ID_1 = $9ED2732B 15 | ID_2 = $38343032 ' cog binary magic number (2048) 16 | 17 | OVERLAY = %00000000_00000001 ' cog binary is an overlay 18 | MAPPING = %00000000_00000010 ' translation table is present 19 | 20 | PUB null 21 | '' This is not a top level object. 22 | 23 | PUB launch(ID, code, data) 24 | '' PASM quick launch using a specific or the next available ID. 25 | '' 26 | '' parameters 27 | '' ID: cog ID 28 | '' 0..7: coginit, otherwise cognew (may fail) 29 | '' code: address of code fragment (4n) 30 | '' data: cognew/coginit parameter (4n) 31 | '' 32 | '' result 33 | '' == 0: [ABORT] thread creation failed (cognew only) 34 | '' <> 0: thread/cog ID + 1 35 | 36 | ifnot (ID >> 3) 37 | coginit(ID++, code, data) 38 | elseifnot ID := cognew(code, data) + 1 39 | abort 40 | return ID 41 | 42 | DAT 43 | -------------------------------------------------------------------------------- /src/zilog/lib.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/zilog/lib.zip -------------------------------------------------------------------------------- /src/zilog/targets.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/makerlisp/229d7010bccb836ad49350cea23f967e80808051/src/zilog/targets.zip --------------------------------------------------------------------------------