├── hdl ├── undo_redo.txt ├── cursor.qip ├── bootrom.qip ├── palette.qip ├── trollbook.dpf ├── cursor.hex ├── .gitignore ├── TROLLBOOK.CDF ├── reset.vhd ├── bootrom.cmp ├── cursor.cmp ├── palette.cmp ├── trollbook.qpf └── wor_logic.vhd ├── src ├── common │ ├── draw │ │ ├── libs │ │ │ ├── util │ │ │ └── peripheral │ │ ├── include │ │ │ └── draw │ │ │ │ ├── pixel.h │ │ │ │ ├── screen.h │ │ │ │ ├── color.h │ │ │ │ ├── bitmap.h │ │ │ │ ├── font.h │ │ │ │ ├── utf8.h │ │ │ │ ├── text.h │ │ │ │ ├── rect.h │ │ │ │ └── line.h │ │ ├── src │ │ │ ├── color.c │ │ │ ├── pixel.c │ │ │ ├── font.c │ │ │ ├── bitmap.c │ │ │ └── Makefile │ │ ├── Makefile │ │ └── config.mk │ ├── muil │ │ ├── libs │ │ │ ├── draw │ │ │ ├── util │ │ │ └── peripheral │ │ ├── include │ │ │ └── muil │ │ │ │ ├── box.h │ │ │ │ ├── messagebox.h │ │ │ │ ├── spacer.h │ │ │ │ ├── pane.h │ │ │ │ ├── label.h │ │ │ │ ├── hbox.h │ │ │ │ ├── vbox.h │ │ │ │ ├── checkbox.h │ │ │ │ ├── slider.h │ │ │ │ ├── progressbar.h │ │ │ │ ├── imageview.h │ │ │ │ ├── button.h │ │ │ │ └── entry.h │ │ ├── Makefile │ │ ├── config.mk │ │ └── src │ │ │ ├── ui.c │ │ │ ├── messagebox.c │ │ │ └── Makefile │ ├── ungzip │ │ ├── libs │ │ │ ├── util │ │ │ └── peripheral │ │ ├── include │ │ │ └── ungzip.h │ │ ├── src │ │ │ ├── ungzip.c │ │ │ └── Makefile │ │ ├── Makefile │ │ └── config.mk │ ├── peripheral │ │ ├── libs │ │ │ └── util │ │ ├── include │ │ │ ├── interrupt.h │ │ │ ├── uart.h │ │ │ ├── spi.h │ │ │ ├── sd.h │ │ │ ├── peripheral.h │ │ │ ├── rom.h │ │ │ └── input.h │ │ ├── Makefile │ │ ├── config.mk │ │ └── src │ │ │ ├── interrupt.c │ │ │ ├── uart.c │ │ │ ├── interrupt.S │ │ │ └── spi.c │ ├── terminal │ │ ├── libs │ │ │ ├── util │ │ │ └── peripheral │ │ ├── include │ │ │ ├── printf.h │ │ │ ├── font.h │ │ │ └── terminal.h │ │ ├── Makefile │ │ ├── config.mk │ │ └── src │ │ │ └── Makefile │ ├── util │ │ ├── libs │ │ │ └── peripheral │ │ ├── include │ │ │ ├── util.h │ │ │ ├── delay.h │ │ │ ├── bios.h │ │ │ └── mem.h │ │ ├── Makefile │ │ ├── config.mk │ │ └── src │ │ │ ├── delay.c │ │ │ └── Makefile │ ├── sound │ │ ├── libs │ │ │ └── peripheral │ │ ├── include │ │ │ ├── wav.h │ │ │ └── sound.h │ │ ├── Makefile │ │ ├── config.mk │ │ └── src │ │ │ ├── sound.c │ │ │ └── Makefile │ ├── file-io │ │ ├── Makefile │ │ ├── config.mk │ │ ├── include │ │ │ └── fat.h │ │ └── src │ │ │ └── Makefile │ └── lz4inflate │ │ ├── Makefile │ │ ├── config.mk │ │ ├── include │ │ └── lz4inflate.h │ │ └── src │ │ └── Makefile ├── stage2 │ ├── .gitignore │ ├── libs │ │ ├── util │ │ ├── sound │ │ ├── file-io │ │ ├── terminal │ │ ├── peripheral │ │ └── Makefile │ ├── include │ │ ├── cache.h │ │ ├── serial-transfer.h │ │ ├── memtest.h │ │ ├── main.h │ │ ├── filebrowse.h │ │ ├── hexload.h │ │ ├── menu.h │ │ └── input.h │ ├── link.ld │ ├── src │ │ ├── cache.S │ │ ├── stage2.S │ │ ├── memtest.c │ │ ├── serial-transfer.c │ │ └── Makefile │ ├── config.mk │ └── Makefile ├── demos │ ├── modplay │ │ ├── .gitignore │ │ ├── libs │ │ │ ├── draw │ │ │ ├── muil │ │ │ ├── util │ │ │ ├── sound │ │ │ ├── file-io │ │ │ ├── rickmod │ │ │ ├── terminal │ │ │ ├── peripheral │ │ │ └── Makefile │ │ ├── include │ │ │ ├── string.h │ │ │ ├── stdlib.h │ │ │ └── main.h │ │ ├── src │ │ │ ├── rand.c │ │ │ ├── crt0.S │ │ │ └── Makefile │ │ ├── link.ld │ │ ├── config.mk │ │ └── Makefile │ ├── trololo │ │ ├── .gitignore │ │ ├── libs │ │ │ ├── util │ │ │ ├── sound │ │ │ ├── file-io │ │ │ ├── terminal │ │ │ ├── peripheral │ │ │ └── Makefile │ │ ├── include │ │ │ ├── demo.h │ │ │ └── main.h │ │ ├── src │ │ │ ├── crt0.S │ │ │ ├── demo.c │ │ │ └── Makefile │ │ ├── link.ld │ │ ├── config.mk │ │ └── Makefile │ ├── tsko │ │ ├── include │ │ │ ├── string.h │ │ │ ├── stdlib.h │ │ │ ├── gfx.h │ │ │ └── main.h │ │ ├── libs │ │ │ ├── sound │ │ │ ├── util │ │ │ ├── file-io │ │ │ ├── rickmod │ │ │ ├── terminal │ │ │ ├── peripheral │ │ │ └── Makefile │ │ ├── src │ │ │ ├── crt0.S │ │ │ ├── gfx.c │ │ │ └── Makefile │ │ ├── link.ld │ │ ├── config.mk │ │ └── Makefile │ ├── timer_test │ │ ├── libs │ │ │ ├── util │ │ │ ├── terminal │ │ │ ├── peripheral │ │ │ └── Makefile │ │ ├── src │ │ │ ├── timer_test.c │ │ │ ├── crt0.S │ │ │ └── Makefile │ │ ├── link.ld │ │ ├── config.mk │ │ └── Makefile │ └── bounce │ │ ├── crt0.S │ │ ├── link.ld │ │ └── bounce.c ├── misc │ ├── fontconv │ │ ├── .gitignore │ │ ├── Makefile │ │ └── fontconv.c │ ├── bios-fupl │ │ └── Makefile │ ├── Makefile │ ├── arne.s │ ├── bootrom.S │ └── hexload-new.s ├── kbd │ ├── main.h │ ├── power.h │ ├── sleep.h │ ├── spi.h │ ├── interrupt.h │ ├── keyboard.h │ ├── mouse.h │ ├── sleep.c │ ├── spi.c │ ├── interrupt.c │ ├── main.c │ └── protocol.h └── stage1 │ └── Makefile ├── hw ├── display-board │ ├── lib │ │ ├── osc.bck │ │ ├── osc.dcm │ │ ├── 39f040.dcm │ │ ├── epc2.dcm │ │ ├── tlc7524.dcm │ │ ├── MC68040FC33V.dcm │ │ ├── ada4851-4.dcm │ │ ├── as7c34098.dcm │ │ ├── er-con40ht-1.dcm │ │ ├── hy57v561620.dcm │ │ ├── idt71v416.dcm │ │ ├── EPF10K50VRC240.bck │ │ ├── EPF10K50VRC240.dcm │ │ ├── s25fl204k0tmfi010.dcm │ │ ├── s25fl204k0tmfi010.lib │ │ ├── osc.lib │ │ ├── ada4851-4.lib │ │ ├── epc2.lib │ │ ├── tlc7524.lib │ │ └── 39f040.lib │ ├── fp-lib-table │ ├── mod │ │ └── RPACK8_SMD.kicad_mod │ └── displayboard.pro ├── motherboard │ ├── lib │ │ ├── epc2.dcm │ │ ├── osc.bck │ │ ├── osc.dcm │ │ ├── 39f040.dcm │ │ ├── ada4851-4.dcm │ │ ├── as7c34098.dcm │ │ ├── idt71v416.dcm │ │ ├── tlc7524.dcm │ │ ├── EPF10K50VRC240.bck │ │ ├── EPF10K50VRC240.dcm │ │ ├── MC68040FC33V.dcm │ │ ├── er-con40ht-1.dcm │ │ ├── hy57v561620.dcm │ │ ├── s25fl204k0tmfi010.dcm │ │ ├── s25fl204k0tmfi010.lib │ │ ├── osc.lib │ │ ├── ada4851-4.lib │ │ ├── epc2.lib │ │ ├── tlc7524.lib │ │ └── 39f040.lib │ ├── gerber │ │ ├── trollbook-rev2-NPTH.drl │ │ └── trollbook-rev2-Edge.Cuts.gm1 │ ├── fp-lib-table │ ├── trollbook-rev2.pro │ ├── mod │ │ └── RPACK8_SMD.kicad_mod │ ├── sym-lib-table │ └── trollbook-rev2.pro.v4 └── peripheral-board │ ├── lib │ ├── amp.bck │ ├── amp.dcm │ ├── vref.dcm │ ├── card-edge.dcm │ ├── joystick.dcm │ ├── switchmode.bck │ ├── switchmode.dcm │ ├── digital-pot.dcm │ ├── audio.dcm │ ├── joystick.lib │ ├── vref.lib │ ├── digital-pot.lib │ ├── audio.lib │ ├── 3364W.kicad_mod │ ├── card-edge.lib │ ├── amp.lib │ ├── SMD-TACT-5.2x5.2x2mm.kicad_mod │ └── ACJS-NH35.kicad_mod │ ├── peripheral-board-cache.lib.v4 │ ├── fp-lib-table │ ├── out │ ├── battery │ │ ├── battery.drl │ │ └── battery-Edge.Cuts.gbr │ └── peripheral-board-Edge.Cuts.gbr │ ├── sym-lib-table │ ├── battery-rescue.lib │ ├── battery-rescue.lib.v4 │ ├── battery.pro │ ├── peripheral-board.pro │ ├── peripheral-board.pro.v4 │ └── battery.pro.v4 ├── doc └── registers │ ├── vga-regs.ods │ ├── sound-regs.ods │ ├── timer-regs.ods │ ├── uart-regs.ods │ └── interrupt-regs.ods ├── .gitmodules ├── cad └── keyboard_prototype │ ├── keycap.fcstd │ ├── keycap.fcstd1 │ ├── keyboard_frame.fcstd │ └── keyboard_frame.fcstd1 └── .gitignore /hdl/undo_redo.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/common/draw/libs/util: -------------------------------------------------------------------------------- 1 | ../../util/ -------------------------------------------------------------------------------- /src/common/muil/libs/draw: -------------------------------------------------------------------------------- 1 | ../../draw/ -------------------------------------------------------------------------------- /src/common/muil/libs/util: -------------------------------------------------------------------------------- 1 | ../../util/ -------------------------------------------------------------------------------- /src/common/ungzip/libs/util: -------------------------------------------------------------------------------- 1 | ../../util/ -------------------------------------------------------------------------------- /src/stage2/.gitignore: -------------------------------------------------------------------------------- 1 | *.elf 2 | *.hex -------------------------------------------------------------------------------- /src/stage2/libs/util: -------------------------------------------------------------------------------- 1 | ../../common/util/ -------------------------------------------------------------------------------- /src/common/peripheral/libs/util: -------------------------------------------------------------------------------- 1 | ../../util/ -------------------------------------------------------------------------------- /src/common/terminal/libs/util: -------------------------------------------------------------------------------- 1 | ../../util/ -------------------------------------------------------------------------------- /src/demos/modplay/.gitignore: -------------------------------------------------------------------------------- 1 | *.elf 2 | *.hex -------------------------------------------------------------------------------- /src/demos/trololo/.gitignore: -------------------------------------------------------------------------------- 1 | *.elf 2 | *.hex -------------------------------------------------------------------------------- /src/misc/fontconv/.gitignore: -------------------------------------------------------------------------------- 1 | /fontconv 2 | -------------------------------------------------------------------------------- /src/stage2/libs/sound: -------------------------------------------------------------------------------- 1 | ../../common/sound/ -------------------------------------------------------------------------------- /src/common/draw/libs/peripheral: -------------------------------------------------------------------------------- 1 | ../../peripheral/ -------------------------------------------------------------------------------- /src/common/muil/libs/peripheral: -------------------------------------------------------------------------------- 1 | ../../peripheral/ -------------------------------------------------------------------------------- /src/common/util/libs/peripheral: -------------------------------------------------------------------------------- 1 | ../../peripheral/ -------------------------------------------------------------------------------- /src/demos/modplay/libs/draw: -------------------------------------------------------------------------------- 1 | ../../../common/draw/ -------------------------------------------------------------------------------- /src/demos/modplay/libs/muil: -------------------------------------------------------------------------------- 1 | ../../../common/muil/ -------------------------------------------------------------------------------- /src/demos/modplay/libs/util: -------------------------------------------------------------------------------- 1 | ../../../common/util/ -------------------------------------------------------------------------------- /src/demos/trololo/libs/util: -------------------------------------------------------------------------------- 1 | ../../../common/util/ -------------------------------------------------------------------------------- /src/demos/tsko/include/string.h: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /src/demos/tsko/libs/sound: -------------------------------------------------------------------------------- 1 | ../../../common/sound/ -------------------------------------------------------------------------------- /src/demos/tsko/libs/util: -------------------------------------------------------------------------------- 1 | ../../../common/util/ -------------------------------------------------------------------------------- /src/stage2/libs/file-io: -------------------------------------------------------------------------------- 1 | ../../common/file-io/ -------------------------------------------------------------------------------- /src/stage2/libs/terminal: -------------------------------------------------------------------------------- 1 | ../../common/terminal/ -------------------------------------------------------------------------------- /src/common/sound/libs/peripheral: -------------------------------------------------------------------------------- 1 | ../../peripheral/ -------------------------------------------------------------------------------- /src/common/terminal/libs/peripheral: -------------------------------------------------------------------------------- 1 | ../../peripheral/ -------------------------------------------------------------------------------- /src/common/ungzip/libs/peripheral: -------------------------------------------------------------------------------- 1 | ../../peripheral/ -------------------------------------------------------------------------------- /src/demos/modplay/include/string.h: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /src/demos/modplay/libs/sound: -------------------------------------------------------------------------------- 1 | ../../../common/sound/ -------------------------------------------------------------------------------- /src/demos/timer_test/libs/util: -------------------------------------------------------------------------------- 1 | ../../../common/util/ -------------------------------------------------------------------------------- /src/demos/trololo/libs/sound: -------------------------------------------------------------------------------- 1 | ../../../common/sound/ -------------------------------------------------------------------------------- /src/demos/tsko/libs/file-io: -------------------------------------------------------------------------------- 1 | ../../../common/file-io/ -------------------------------------------------------------------------------- /src/demos/tsko/libs/rickmod: -------------------------------------------------------------------------------- 1 | ../../../common/rickmod/ -------------------------------------------------------------------------------- /src/demos/tsko/libs/terminal: -------------------------------------------------------------------------------- 1 | ../../../common/terminal/ -------------------------------------------------------------------------------- /src/stage2/libs/peripheral: -------------------------------------------------------------------------------- 1 | ../../common/peripheral/ -------------------------------------------------------------------------------- /src/demos/modplay/libs/file-io: -------------------------------------------------------------------------------- 1 | ../../../common/file-io/ -------------------------------------------------------------------------------- /src/demos/modplay/libs/rickmod: -------------------------------------------------------------------------------- 1 | ../../../common/rickmod/ -------------------------------------------------------------------------------- /src/demos/modplay/libs/terminal: -------------------------------------------------------------------------------- 1 | ../../../common/terminal/ -------------------------------------------------------------------------------- /src/demos/timer_test/libs/terminal: -------------------------------------------------------------------------------- 1 | ../../../common/terminal -------------------------------------------------------------------------------- /src/demos/trololo/libs/file-io: -------------------------------------------------------------------------------- 1 | ../../../common/file-io/ -------------------------------------------------------------------------------- /src/demos/trololo/libs/terminal: -------------------------------------------------------------------------------- 1 | ../../../common/terminal/ -------------------------------------------------------------------------------- /src/demos/tsko/libs/peripheral: -------------------------------------------------------------------------------- 1 | ../../../common/peripheral/ -------------------------------------------------------------------------------- /src/demos/modplay/libs/peripheral: -------------------------------------------------------------------------------- 1 | ../../../common/peripheral/ -------------------------------------------------------------------------------- /src/demos/timer_test/libs/peripheral: -------------------------------------------------------------------------------- 1 | ../../../common/peripheral/ -------------------------------------------------------------------------------- /src/demos/trololo/libs/peripheral: -------------------------------------------------------------------------------- 1 | ../../../common/peripheral/ -------------------------------------------------------------------------------- /hw/display-board/lib/osc.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/display-board/lib/osc.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/epc2.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/osc.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/osc.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/display-board/lib/39f040.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/display-board/lib/epc2.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/display-board/lib/tlc7524.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/39f040.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/ada4851-4.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/as7c34098.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/idt71v416.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/tlc7524.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/amp.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/amp.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/vref.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /src/misc/fontconv/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | gcc -o fontconv -Wall fontconv.c -lSDL -lSDL_image 3 | -------------------------------------------------------------------------------- /hw/display-board/lib/MC68040FC33V.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/display-board/lib/ada4851-4.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/display-board/lib/as7c34098.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/display-board/lib/er-con40ht-1.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/display-board/lib/hy57v561620.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/display-board/lib/idt71v416.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/EPF10K50VRC240.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/EPF10K50VRC240.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/MC68040FC33V.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/er-con40ht-1.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/lib/hy57v561620.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/card-edge.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/joystick.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/switchmode.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/switchmode.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /src/demos/tsko/include/stdlib.h: -------------------------------------------------------------------------------- 1 | #ifndef STDLIB_H_ 2 | #define STDLIB_H_ 3 | 4 | 5 | 6 | #endif -------------------------------------------------------------------------------- /hw/display-board/lib/EPF10K50VRC240.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/display-board/lib/EPF10K50VRC240.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/display-board/lib/s25fl204k0tmfi010.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/motherboard/gerber/trollbook-rev2-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | INCH,TZ 3 | % 4 | G90 5 | G05 6 | T0 7 | M30 8 | -------------------------------------------------------------------------------- /hw/motherboard/lib/s25fl204k0tmfi010.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/digital-pot.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /src/demos/modplay/include/stdlib.h: -------------------------------------------------------------------------------- 1 | #ifndef STDLIB_H_ 2 | #define STDLIB_H_ 3 | 4 | 5 | 6 | #endif -------------------------------------------------------------------------------- /doc/registers/vga-regs.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trollectronics/trollbook/HEAD/doc/registers/vga-regs.ods -------------------------------------------------------------------------------- /src/stage2/include/cache.h: -------------------------------------------------------------------------------- 1 | #ifndef _CACHE_H 2 | #define _CACHE_H 3 | 4 | void invalidate(); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /doc/registers/sound-regs.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trollectronics/trollbook/HEAD/doc/registers/sound-regs.ods -------------------------------------------------------------------------------- /doc/registers/timer-regs.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trollectronics/trollbook/HEAD/doc/registers/timer-regs.ods -------------------------------------------------------------------------------- /doc/registers/uart-regs.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trollectronics/trollbook/HEAD/doc/registers/uart-regs.ods -------------------------------------------------------------------------------- /src/demos/trololo/include/demo.h: -------------------------------------------------------------------------------- 1 | #ifndef DEMO_H_ 2 | #define DEMO_H_ 3 | 4 | void demo_run(); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/kbd/main.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_H_ 2 | #define MAIN_H_ 3 | 4 | void timer_init(); 5 | void timer_deinit(); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/misc/bios-fupl/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | $(CC) -Wall -o bios-fupl.elf bios-fupl.c 3 | 4 | clean: 5 | rm bios-fupl.elf 6 | -------------------------------------------------------------------------------- /doc/registers/interrupt-regs.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trollectronics/trollbook/HEAD/doc/registers/interrupt-regs.ods -------------------------------------------------------------------------------- /hw/peripheral-board/peripheral-board-cache.lib.v4: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | #End Library 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/common/rickmod"] 2 | path = src/common/rickmod 3 | url = https://github.com/slaeshjag/rickmod.git 4 | -------------------------------------------------------------------------------- /cad/keyboard_prototype/keycap.fcstd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trollectronics/trollbook/HEAD/cad/keyboard_prototype/keycap.fcstd -------------------------------------------------------------------------------- /cad/keyboard_prototype/keycap.fcstd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trollectronics/trollbook/HEAD/cad/keyboard_prototype/keycap.fcstd1 -------------------------------------------------------------------------------- /hw/display-board/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name mod)(type KiCad)(uri "$(KIPRJMOD)/mod")(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /src/demos/modplay/src/rand.c: -------------------------------------------------------------------------------- 1 | int rand() { 2 | // chosen by a fair dice roll 3 | // guaranteed to be random 4 | return 4; 5 | } 6 | -------------------------------------------------------------------------------- /hw/peripheral-board/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name lib)(type KiCad)(uri "$(KIPRJMOD)/lib")(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /cad/keyboard_prototype/keyboard_frame.fcstd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trollectronics/trollbook/HEAD/cad/keyboard_prototype/keyboard_frame.fcstd -------------------------------------------------------------------------------- /cad/keyboard_prototype/keyboard_frame.fcstd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trollectronics/trollbook/HEAD/cad/keyboard_prototype/keyboard_frame.fcstd1 -------------------------------------------------------------------------------- /src/common/draw/include/draw/pixel.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAW_PIXEL_H_ 2 | #define DRAW_PIXEL_H_ 3 | 4 | void draw_pixel(int x, int y); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/stage2/include/serial-transfer.h: -------------------------------------------------------------------------------- 1 | #ifndef _SERIAL_TRANSFER_H 2 | #define _SERIAL_TRANSFER_H 3 | 4 | void serial_transfer_recv(); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/common/ungzip/include/ungzip.h: -------------------------------------------------------------------------------- 1 | #ifndef UNGZIP_H_ 2 | #define UNGZIP_H_ 3 | 4 | void *ungzip(void *indata, int inlen, int *outlen); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/common/util/include/util.h: -------------------------------------------------------------------------------- 1 | #ifndef _UTIL_H_ 2 | #define _UTIL_H_ 3 | 4 | #define nop() do {__asm__ __volatile__ ("nop\n");} while(0) 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/demos/trololo/include/main.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_H_ 2 | #define MAIN_H_ 3 | 4 | #include 5 | 6 | extern uint8_t fat_buf[512]; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/common/draw/src/color.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | DrawColor draw_color; 4 | 5 | void draw_set_color(DrawColor col) { 6 | draw_color = col; 7 | } 8 | -------------------------------------------------------------------------------- /src/stage2/include/memtest.h: -------------------------------------------------------------------------------- 1 | #ifndef MEMTEST_H__ 2 | #define MEMTEST_H__ 3 | 4 | // Returns 1 on success, 0 on failure 5 | int memtest_run(); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/common/sound/include/wav.h: -------------------------------------------------------------------------------- 1 | #ifndef WAV_H_ 2 | #define WAV_H_ 3 | 4 | #include 5 | 6 | void wav_play(uint8_t *buf); 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /src/kbd/power.h: -------------------------------------------------------------------------------- 1 | #ifndef POWER_H_ 2 | #define POWER_H_ 3 | 4 | void power_init(); 5 | void power_tick(); 6 | void power_on(); 7 | void power_off(); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/kbd/sleep.h: -------------------------------------------------------------------------------- 1 | #ifndef SLEEP_H_ 2 | #define SLEEP_H_ 3 | 4 | #include 5 | 6 | void usleep(uint16_t us); 7 | void msleep(uint16_t ms); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | *.swp 3 | *.o 4 | *.elf 5 | *.bin 6 | *.hex 7 | *.orig 8 | *.a 9 | .deps 10 | build/ 11 | 12 | _autosave*.kicad_pcb 13 | *..kicad_pcb-bak 14 | .~lock* 15 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/audio.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | $CMP FCR1295 4 | D audio jack TRS 6 pins 5 | K audio jack connector TRS 6 | $ENDCMP 7 | # 8 | #End Doc Library 9 | -------------------------------------------------------------------------------- /src/stage2/include/main.h: -------------------------------------------------------------------------------- 1 | #ifndef _MAIN_H 2 | #define _MAIN_H 3 | 4 | #include 5 | 6 | extern uint8_t fat_buf[512]; 7 | 8 | void reboot(void *); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/common/sound/include/sound.h: -------------------------------------------------------------------------------- 1 | #ifndef SOUND_H_ 2 | #define SOUND_H_ 3 | 4 | void sound_setup(void *buf_addr); 5 | void sound_start(); 6 | void sound_stop(); 7 | int sound_wait(); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/common/terminal/include/printf.h: -------------------------------------------------------------------------------- 1 | #ifndef __PRINTF_H__ 2 | #define __PRINTF_H__ 3 | #include 4 | 5 | int printf(char *format, ...); 6 | int vprintf(char *format, va_list va); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/common/terminal/include/font.h: -------------------------------------------------------------------------------- 1 | #ifndef FONT_H_ 2 | #define FONT_H_ 3 | 4 | #include 5 | 6 | extern uint8_t vgafont_data[2672]; 7 | extern uint8_t smallfont_data[1024]; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/kbd/spi.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_H_ 2 | #define SPI_H_ 3 | 4 | #include "stdint.h" 5 | 6 | void spi_init(); 7 | void spi_deinit(); 8 | void spi_send(uint8_t data); 9 | uint8_t spi_recv(); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /hw/motherboard/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name mod)(type KiCad)(uri "$(KIPRJMOD)/mod")(options "")(descr "")) 3 | (lib (name trollbook)(type Legacy)(uri "$(KIPRJMOD)/mod/trollbook.mod")(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /src/common/draw/include/draw/screen.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAW_SCREEN_H_ 2 | #define DRAW_SCREEN_H_ 3 | 4 | #include "color.h" 5 | 6 | #define DRAW_SCREEN_W 800 7 | #define DRAW_SCREEN_H 480 8 | 9 | extern DrawColor *draw_framebuffer; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/stage2/include/filebrowse.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILEBROWSE_H 2 | #define _FILEBROWSE_H 3 | 4 | #include 5 | #include "menu.h" 6 | 7 | extern Menu menu_dir; 8 | 9 | void execute_elf_path(const char *_path, bool debug); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/kbd/interrupt.h: -------------------------------------------------------------------------------- 1 | #ifndef INTERRUPT_H_ 2 | #define INTERRUPT_H_ 3 | 4 | #include 5 | 6 | void interrupt_init(bool interrupt); 7 | void interrupt_deinit(); 8 | void interrupt_assert(); 9 | void interrupt_deassert(); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/common/draw/include/draw/color.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAW_COLOR_H_ 2 | #define DRAW_COLOR_H_ 3 | 4 | #include 5 | 6 | typedef uint8_t DrawColor; 7 | 8 | extern DrawColor draw_color; 9 | 10 | void draw_set_color(DrawColor col); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/common/util/include/delay.h: -------------------------------------------------------------------------------- 1 | #ifndef _DELAY_H_ 2 | #define _DELAY_H_ 3 | #include 4 | 5 | void dumbdelay(volatile uint32_t t); 6 | void delay_timer_set_prescale(uint16_t prescaler); 7 | void delay_timer(int timer, int32_t msec); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/demos/modplay/include/main.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_H_ 2 | #define MAIN_H_ 3 | 4 | #include 5 | #include 6 | 7 | extern uint8_t fat_buf[512]; 8 | extern DrawFont *font_small; 9 | 10 | void browse(); 11 | void player_init(); 12 | void play(); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/demos/tsko/include/gfx.h: -------------------------------------------------------------------------------- 1 | #ifndef GFX_H_ 2 | #define GFX_H_ 3 | 4 | void gfx_set_lowres(); 5 | void gfx_buffer_flip(); 6 | void gfx_blit(void *image, int width, int x, int y); 7 | void gfx_blit_fast(void *image, unsigned width, unsigned height, unsigned x, unsigned y); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /hdl/cursor.qip: -------------------------------------------------------------------------------- 1 | set_global_assignment -name IP_TOOL_NAME "RAM: 1-PORT" 2 | set_global_assignment -name IP_TOOL_VERSION "9.0" 3 | set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "cursor.vhd"] 4 | set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "cursor.cmp"] 5 | -------------------------------------------------------------------------------- /hdl/bootrom.qip: -------------------------------------------------------------------------------- 1 | set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT" 2 | set_global_assignment -name IP_TOOL_VERSION "9.0" 3 | set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "bootrom.vhd"] 4 | set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "bootrom.cmp"] 5 | -------------------------------------------------------------------------------- /hdl/palette.qip: -------------------------------------------------------------------------------- 1 | set_global_assignment -name IP_TOOL_NAME "RAM: 1-PORT" 2 | set_global_assignment -name IP_TOOL_VERSION "9.0" 3 | set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "palette.vhd"] 4 | set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "palette.cmp"] 5 | -------------------------------------------------------------------------------- /hdl/trollbook.dpf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /hw/peripheral-board/out/battery/battery.drl: -------------------------------------------------------------------------------- 1 | M48 2 | INCH,TZ 3 | T1C0.028 4 | T2C0.031 5 | T3C0.039 6 | % 7 | G90 8 | G05 9 | T1 10 | X591Y3453 11 | X591Y2953 12 | X606Y984 13 | X606Y484 14 | T2 15 | X18701Y3346 16 | X18701Y2362 17 | T3 18 | X16929Y2969 19 | X16929Y1969 20 | X16929Y969 21 | T0 22 | M30 23 | -------------------------------------------------------------------------------- /src/common/draw/src/pixel.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | DrawColor *draw_framebuffer = (void *) 0x00080000UL; 7 | 8 | void draw_pixel(int x, int y) { 9 | draw_framebuffer[y * DRAW_SCREEN_W + x] = draw_color; 10 | } 11 | -------------------------------------------------------------------------------- /src/kbd/keyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef KEYBOARD_H_ 2 | #define KEYBOARD_H_ 3 | 4 | #include 5 | 6 | uint8_t keyboard_init(); 7 | void keyboard_deinit(); 8 | void keyboard_event_push(uint8_t ev); 9 | int16_t keyboard_event_pop(); 10 | uint8_t keyboard_events(); 11 | void keyboard_tick(); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /hdl/cursor.hex: -------------------------------------------------------------------------------- 1 | :200000000303000000000000030203000000000003020203000000000302020203000000BC 2 | :2000200003020202020300000302020202020300030202020202020303020202020303037C 3 | :2000400003020302020300000303000302020300000000000302030000000000030202036F 4 | :20006000000000000003020300000000000003000000000000000000000000000000000075 5 | :00000001FF 6 | -------------------------------------------------------------------------------- /hdl/.gitignore: -------------------------------------------------------------------------------- 1 | /db 2 | /incremental_db 3 | /simulation 4 | /work 5 | /transcript 6 | /vish_stacktrace.vstf 7 | /greybox_tmp 8 | /serv_req_info.txt 9 | /vsim_stacktrace.vstf 10 | /wlft* 11 | *.rpt 12 | *.summary 13 | *.done 14 | *.sof 15 | *.pof 16 | *.qws 17 | *.bak 18 | *.pin 19 | *.mti 20 | *.wlf 21 | !pal565.hex 22 | !bootrom.hex 23 | !cursor.hex 24 | -------------------------------------------------------------------------------- /hw/peripheral-board/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name battery-rescue)(type Legacy)(uri ${KIPRJMOD}/battery-rescue.lib)(options "")(descr "")) 3 | (lib (name vref)(type Legacy)(uri ${KIPRJMOD}/lib/vref.lib)(options "")(descr "")) 4 | (lib (name peripheral-board-rescue)(type Legacy)(uri ${KIPRJMOD}/peripheral-board-rescue.lib)(options "")(descr "")) 5 | ) 6 | -------------------------------------------------------------------------------- /src/common/util/include/bios.h: -------------------------------------------------------------------------------- 1 | #ifndef _BIOS_H_ 2 | #define _BIOS_H_ 3 | 4 | typedef struct BiosInfo BiosInfo; 5 | struct BiosInfo { 6 | unsigned char *font; 7 | int term_x; 8 | int term_y; 9 | int def_fg; 10 | int def_bg; 11 | 12 | int vsync_clock; 13 | }; 14 | 15 | #define BIOS_INFO_ADDR ((volatile BiosInfo *) 0xDDC00) 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/kbd/mouse.h: -------------------------------------------------------------------------------- 1 | #ifndef MOUSE_H_ 2 | #define MOUSE_H_ 3 | 4 | #define MOUSE_THRESHOLD 50 5 | 6 | #include 7 | #include 8 | #include "mouse.h" 9 | 10 | #define ABS(a) ((a) > 0 ? (a) : (-a)) 11 | 12 | void mouse_init(); 13 | void mouse_deinit(); 14 | void mouse_state_get(uint8_t *buf); 15 | void mouse_vel_get(uint8_t *buf); 16 | void mouse_tick(); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/stage1/Makefile: -------------------------------------------------------------------------------- 1 | MAKEFLAGS += --no-print-directory 2 | 3 | 4 | 5 | hexload.bin: hexload.elf 6 | m68k-elf-objcopy -O binary $< $@ 7 | xxd -g 4 -c 4 -p < $@ | tr "\n" ' ' 8 | @echo 9 | hexwrite ../../hdl/bootrom.hex record_width=4 word_size=4 input=$@ 10 | 11 | hexload.elf: hexload.s spi_load.s 12 | m68k-elf-as -m68040 -o $@ $< 13 | 14 | clean: 15 | $(RM) hexload.elf hexload.bin 16 | -------------------------------------------------------------------------------- /src/demos/bounce/crt0.S: -------------------------------------------------------------------------------- 1 | .align 2 2 | 3 | .global _start 4 | _start: 5 | | lea __bss_start, %a0 6 | | lea __bss_end, %a1 7 | | 8 | |1: 9 | | cmp.l %a0, %a1 10 | | beq 2f 11 | | move.b #0x00, (%a0)+ 12 | | bra 1b 13 | 14 | 2: 15 | cinva %bc 16 | move.l #0x80008000, %d0 17 | movec %d0, %cacr 18 | 19 | bra main 20 | 21 | cmp #0, %d0 22 | bne fail 23 | success: 24 | jmp 0xC 25 | fail: 26 | jmp 0x10 27 | -------------------------------------------------------------------------------- /src/stage2/include/hexload.h: -------------------------------------------------------------------------------- 1 | #ifndef _LOADHEX_H_ 2 | #define _LOADHEX_H_ 3 | #include 4 | 5 | int hexload_verify_byte(volatile uint8_t *addr, uint8_t data, void *arg); 6 | int hexload_write_byte(volatile uint8_t *addr, uint8_t data, void *arg); 7 | 8 | int hexload(uint8_t (* fetch_byte)(int), int fd, int (data_byte)(volatile uint8_t *addr, uint8_t data, void *arg), void *data_byte_arg, void **addr_out); 9 | #endif 10 | -------------------------------------------------------------------------------- /src/common/ungzip/src/ungzip.c: -------------------------------------------------------------------------------- 1 | #define INT_MAX 0x7FFFFFF 2 | 3 | #define STBI_ONLY_PNG 4 | #define STBI_SUPPORT_ZLIB 5 | #define STBI_NO_PNG 6 | #define STBI_NO_STDIO 7 | #define STBI_ASSERT 8 | #define STB_IMAGE_IMPLEMENTATION 9 | #define STBI_NO_LINEAR 10 | 11 | #include 12 | #include "stb_image.h" 13 | 14 | 15 | void *ungzip(void *indata, int inlen, int *outlen) { 16 | return stbi_zlib_decode_malloc(indata, inlen, outlen); 17 | } 18 | -------------------------------------------------------------------------------- /hdl/TROLLBOOK.CDF: -------------------------------------------------------------------------------- 1 | /* Quartus II Version 9.0 Build 235 06/17/2009 Service Pack 2 SJ Web Edition */ 2 | JedecChain; 3 | FileRevision(JESD32A); 4 | DefaultMfr(6E); 5 | 6 | P ActionCode(Cfg) 7 | Device PartName(EPF10K50VR240) Path("G:/trollbook/hdl/") File("trollbook.sof") MfrSpec(OpMask(1)); 8 | P ActionCode(Ign) 9 | Device PartName(EPC2) MfrSpec(OpMask(0)); 10 | 11 | ChainEnd; 12 | 13 | AlteraBegin; 14 | ChainType(JTAG); 15 | AlteraEnd; 16 | -------------------------------------------------------------------------------- /src/stage2/include/menu.h: -------------------------------------------------------------------------------- 1 | #ifndef _MENU_H_ 2 | #define _MENU_H_ 3 | 4 | #include 5 | 6 | typedef struct MenuItem MenuItem; 7 | struct MenuItem { 8 | const char *text; 9 | void (*func)(void *arg); 10 | void *arg; 11 | }; 12 | 13 | typedef struct Menu Menu; 14 | struct Menu { 15 | void (*header)(void *); 16 | void *arg; 17 | bool has_back; 18 | int selected; 19 | int items; 20 | MenuItem item[]; 21 | }; 22 | 23 | void menu_execute(void *menu); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/kbd/sleep.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | //TODO: sleep is broken 5 | void usleep(uint16_t us) { 6 | TCCR1A = 0x04; //reset on match mode 7 | OCR1A = us; 8 | TCNT1 = 0; 9 | TIFR1 |= 0x2; 10 | //TCCR1B = 0x01; //internal clock, prescale by 1 11 | TCCR1B = 0x02; //internal clock, prescale by 8 12 | 13 | while(!(TIFR1 & 0x2)); 14 | TCCR1B = 0x00; 15 | TIFR1 |= 0x2; 16 | } 17 | 18 | void msleep(uint16_t ms) { 19 | while(ms--) 20 | usleep(1000); 21 | } 22 | -------------------------------------------------------------------------------- /src/stage2/link.ld: -------------------------------------------------------------------------------- 1 | _stack = 0x100000; 2 | 3 | MEMORY { 4 | vram(rwx): ORIGIN = 0x80000, LENGTH = 384000 5 | bios(rwx): ORIGIN = 0xDDC00, LENGTH = 0x100 6 | ram(rwx): ORIGIN = 0xDDD00, LENGTH = 0x22300 7 | } 8 | 9 | SECTIONS { 10 | .text : { 11 | *(.text) 12 | *(.rodata*) 13 | } > ram 14 | .data : { 15 | *(.data) 16 | } > ram 17 | .bss : { 18 | __bss_start = .; 19 | *(.bss) 20 | *(COMMON) 21 | __bss_end = .; 22 | } > ram 23 | end = .; 24 | } 25 | 26 | ENTRY(_start) 27 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/joystick.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # PSPNUB 5 | # 6 | DEF PSPNUB U 0 40 Y Y 1 F N 7 | F0 "U" 0 -50 60 H V C CNN 8 | F1 "PSPNUB" 0 50 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | DRAW 12 | S -300 300 300 -300 0 1 0 N 13 | X X 1 500 50 200 L 50 50 1 1 P 14 | X GND 2 0 -500 200 U 50 50 1 1 W 15 | X Y 3 500 -50 200 L 50 50 1 1 P 16 | X VCC 4 0 500 200 D 50 50 1 1 W 17 | ENDDRAW 18 | ENDDEF 19 | # 20 | #End Library 21 | -------------------------------------------------------------------------------- /src/stage2/src/cache.S: -------------------------------------------------------------------------------- 1 | .section text 2 | 3 | .global invalidate 4 | .align 2 5 | invalidate: 6 | cinva %bc 7 | rts 8 | 9 | .global lolhest 10 | .align 2 11 | lolhest: 12 | move.l #0x40000000, %a0 13 | lea hejtest, %a1 14 | move16 (%a0)+, (%a1)+ 15 | rts 16 | 17 | .align 4 18 | loldata: 19 | .int 0xDEADBEEF 20 | .int 0x00000000 21 | .int 0xCAFEBABE 22 | .int 0x5A5A5A5A 23 | 24 | .section data 25 | .align 4 26 | .global hejtest 27 | hejtest: 28 | .int 0x0 29 | .int 0x0 30 | .int 0x0 31 | .int 0x0 32 | -------------------------------------------------------------------------------- /src/demos/timer_test/src/timer_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | 6 | int main(int argc, char **argv) { 7 | int i, j; 8 | 9 | terminal_init(); 10 | terminal_clear(); 11 | 12 | delay_timer_set_prescale(30000); 13 | 14 | for (;;) { 15 | for (j = 0; j < 20; j++) { 16 | for (i = 0; i < 3; i++) { 17 | delay_timer(0, 250); 18 | printf("."); 19 | } 20 | 21 | delay_timer(3, 250); 22 | printf("#"); 23 | } 24 | 25 | printf("\n"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/box.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_BOX_H 11 | #define MUIL_BOX_H 12 | 13 | typedef struct MuilWidgetList { 14 | MuilWidget *widget; 15 | int expand; 16 | struct MuilWidgetList *next; 17 | } MuilWidgetList; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/common/peripheral/include/interrupt.h: -------------------------------------------------------------------------------- 1 | #ifndef INTERRUPT_H_ 2 | #define INTERRUPT_H_ 3 | 4 | #include 5 | 6 | #define INTERRUPT_OFFSET_TRAP 32 7 | 8 | void interrupt_isr_unhandled(); 9 | void interrupt_isr_trampoline(); 10 | 11 | void interrupt_init(); 12 | void interrupt_perihperal_enable(uint32_t n, uint8_t priority); 13 | void interrupt_register(int priority, void (h)(int)); 14 | void interrupt_move_vector(void *addr); 15 | 16 | void interrupt_global_enable(); 17 | void interrupt_global_disable(); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/demos/trololo/src/crt0.S: -------------------------------------------------------------------------------- 1 | .align 2 2 | 3 | .global _start 4 | _start: 5 | lea __bss_start, %a0 6 | lea __bss_end, %a1 7 | 8 | move.l %a1, %d0 9 | addq.l #3, %d0 10 | andi.l #0xFFFFFFFC, %d0 11 | move.l %d0, %a1 12 | 13 | 1: 14 | cmp.l %a0, %a1 15 | beq 2f 16 | move.l #0x00, (%a0)+ 17 | bra 1b 18 | 19 | 2: 20 | cinva %bc 21 | move.l #0x80008000, %d0 22 | movec %d0, %cacr 23 | 24 | bra main 25 | 26 | cmp #0, %d0 27 | bne fail 28 | success: 29 | bra loop 30 | fail: 31 | bra loop 32 | 33 | loop: 34 | bra loop 35 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/messagebox.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_MESSAGEBOX_H 11 | void muil_messagebox(DrawFont *font, const char *text, const char *button_text); 12 | void muil_messagebox_button_click(MuilWidget *widget, unsigned int type, MuilEvent *e); 13 | #endif 14 | -------------------------------------------------------------------------------- /src/common/peripheral/include/uart.h: -------------------------------------------------------------------------------- 1 | #ifndef _UART_H_ 2 | #define _UART_H_ 3 | #include 4 | #include "peripheral.h" 5 | 6 | #define UART_REG_DATA *((volatile uint32_t *) (PERIPHERAL_UART_BASE + 0x0)) 7 | #define UART_REG_STATUS *((volatile uint32_t *) (PERIPHERAL_UART_BASE + 0x4)) 8 | 9 | void uart_send(uint8_t dat); 10 | uint8_t uart_flush(); 11 | uint8_t uart_recv(); 12 | void uart_send_hex(uint8_t h); 13 | void uart_send_string(char *s); 14 | 15 | void uart_putc_convnl(char c); 16 | void uart_puts_convnl(const char *s); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/demos/tsko/src/crt0.S: -------------------------------------------------------------------------------- 1 | .align 2 2 | 3 | .global _start 4 | _start: 5 | move.l #0x84000000, %a7 6 | lea __bss_start, %a0 7 | lea __bss_end, %a1 8 | 9 | move.l %a1, %d0 10 | addq.l #3, %d0 11 | andi.l #0xFFFFFFFC, %d0 12 | move.l %d0, %a1 13 | 14 | 1: 15 | cmp.l %a0, %a1 16 | beq 2f 17 | move.l #0x00, (%a0)+ 18 | bra 1b 19 | 20 | 2: 21 | cinva %bc 22 | move.l #0x80008000, %d0 23 | movec %d0, %cacr 24 | 25 | bra.l main 26 | 27 | cmp #0, %d0 28 | bne fail 29 | success: 30 | bra loop 31 | fail: 32 | bra loop 33 | 34 | loop: 35 | bra loop 36 | -------------------------------------------------------------------------------- /src/stage2/include/input.h: -------------------------------------------------------------------------------- 1 | #ifndef _INPUT_H_ 2 | #define _INPUT_H_ 3 | 4 | #include 5 | 6 | typedef struct InputButtons InputButtons; 7 | struct InputButtons { 8 | uint32_t left : 1; 9 | uint32_t right : 1; 10 | uint32_t up : 1; 11 | uint32_t down : 1; 12 | 13 | uint32_t enter : 1; 14 | uint32_t back : 1; 15 | }; 16 | 17 | InputButtons input_poll_uart(); 18 | InputButtons input_poll_temp_spi(); 19 | InputButtons input_poll_keyboard(); 20 | void input_test_keyboard(void *arg); 21 | 22 | #define input_poll input_poll_keyboard 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/demos/modplay/src/crt0.S: -------------------------------------------------------------------------------- 1 | .align 2 2 | 3 | .global _start 4 | _start: 5 | move.l #0x84000000, %a7 6 | lea __bss_start, %a0 7 | lea __bss_end, %a1 8 | 9 | move.l %a1, %d0 10 | addq.l #3, %d0 11 | andi.l #0xFFFFFFFC, %d0 12 | move.l %d0, %a1 13 | 14 | 1: 15 | cmp.l %a0, %a1 16 | beq 2f 17 | move.l #0x00, (%a0)+ 18 | bra 1b 19 | 20 | 2: 21 | cinva %bc 22 | move.l #0x80008000, %d0 23 | movec %d0, %cacr 24 | 25 | bra.l main 26 | 27 | cmp #0, %d0 28 | bne fail 29 | success: 30 | bra loop 31 | fail: 32 | bra loop 33 | 34 | loop: 35 | bra loop 36 | -------------------------------------------------------------------------------- /src/demos/timer_test/src/crt0.S: -------------------------------------------------------------------------------- 1 | .align 2 2 | 3 | .global _start 4 | _start: 5 | move.l #0x84000000, %a7 6 | lea __bss_start, %a0 7 | lea __bss_end, %a1 8 | 9 | move.l %a1, %d0 10 | addq.l #3, %d0 11 | andi.l #0xFFFFFFFC, %d0 12 | move.l %d0, %a1 13 | 14 | 1: 15 | cmp.l %a0, %a1 16 | beq 2f 17 | move.l #0x00, (%a0)+ 18 | bra 1b 19 | 20 | 2: 21 | cinva %bc 22 | move.l #0x80008000, %d0 23 | movec %d0, %cacr 24 | 25 | bra.l main 26 | 27 | cmp #0, %d0 28 | bne fail 29 | success: 30 | bra loop 31 | fail: 32 | bra loop 33 | 34 | loop: 35 | bra loop 36 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/vref.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # TL431 5 | # 6 | DEF TL431 U 0 40 Y Y 1 F N 7 | F0 "U" 200 -50 60 H V C CNN 8 | F1 "TL431" 250 50 60 H V C CNN 9 | F2 "" -650 0 60 H I C CNN 10 | F3 "" -650 0 60 H I C CNN 11 | DRAW 12 | S -100 100 100 -100 0 1 0 N 13 | P 2 0 1 0 -50 0 -25 0 N 14 | P 3 0 1 0 0 50 -50 50 -50 75 N 15 | P 3 0 1 0 0 50 50 50 50 25 N 16 | P 5 0 1 0 0 -50 -50 -50 0 50 50 -50 0 -50 N 17 | X ~ 1 -250 0 200 R 50 50 1 1 P 18 | X ~ 2 0 -250 200 U 50 50 1 1 P 19 | X ~ 3 0 250 200 D 50 50 1 1 P 20 | ENDDRAW 21 | ENDDEF 22 | # 23 | #End Library 24 | -------------------------------------------------------------------------------- /src/common/draw/include/draw/bitmap.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAW_BITMAP_H_ 2 | #define DRAW_BITMAP_H_ 3 | 4 | #include 5 | #include "color.h" 6 | 7 | typedef struct DrawBitmap DrawBitmap; 8 | struct DrawBitmap { 9 | DrawColor *data; 10 | bool free_data; 11 | int x; 12 | int y; 13 | int w; 14 | int h; 15 | }; 16 | 17 | DrawBitmap *draw_bitmap_new(int w, int h, DrawColor *data); 18 | DrawBitmap *draw_bitmap_new_raw(int w, int h); 19 | void draw_bitmap_free(DrawBitmap *bitmap); 20 | void draw_bitmap_move(DrawBitmap *bitmap, int x, int y); 21 | void draw_bitmap_draw(DrawBitmap *bitmap); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/stage2/libs/Makefile: -------------------------------------------------------------------------------- 1 | # Sub directories to build 2 | SUBDIRS = $(patsubst %/,%,$(foreach subdir,$(wildcard */Makefile),$(dir $(subdir)))) 3 | LIBFILES = $(addsuffix .a,$(SUBDIRS)) 4 | 5 | .PHONY: all clean 6 | .PHONY: $(SUBDIRS) 7 | 8 | all: $(LIBFILES) 9 | @echo "Plugins build complete." 10 | @echo 11 | 12 | clean: $(SUBDIRS) 13 | @echo " [ RM ] $(LIBFILES)" 14 | @$(RM) $(LIBFILES) 15 | 16 | @echo 17 | @echo "Plugins source tree cleaned." 18 | @echo 19 | 20 | $(SUBDIRS): 21 | @echo " [ CD ] $(CURRENTPATH)$@/" 22 | @+make -C "$@" $(MAKECMDGOALS) 23 | 24 | %.a: $(SUBDIRS) 25 | @cp $*/$@ $@ -------------------------------------------------------------------------------- /src/demos/modplay/libs/Makefile: -------------------------------------------------------------------------------- 1 | # Sub directories to build 2 | SUBDIRS = $(patsubst %/,%,$(foreach subdir,$(wildcard */Makefile),$(dir $(subdir)))) 3 | LIBFILES = $(addsuffix .a,$(SUBDIRS)) 4 | 5 | .PHONY: all clean 6 | .PHONY: $(SUBDIRS) 7 | 8 | all: $(LIBFILES) 9 | @echo "Plugins build complete." 10 | @echo 11 | 12 | clean: $(SUBDIRS) 13 | @echo " [ RM ] $(LIBFILES)" 14 | @$(RM) $(LIBFILES) 15 | 16 | @echo 17 | @echo "Plugins source tree cleaned." 18 | @echo 19 | 20 | $(SUBDIRS): 21 | @echo " [ CD ] $(CURRENTPATH)$@/" 22 | @+make -C "$@" $(MAKECMDGOALS) 23 | 24 | %.a: $(SUBDIRS) 25 | @cp $*/$@ $@ -------------------------------------------------------------------------------- /src/demos/trololo/libs/Makefile: -------------------------------------------------------------------------------- 1 | # Sub directories to build 2 | SUBDIRS = $(patsubst %/,%,$(foreach subdir,$(wildcard */Makefile),$(dir $(subdir)))) 3 | LIBFILES = $(addsuffix .a,$(SUBDIRS)) 4 | 5 | .PHONY: all clean 6 | .PHONY: $(SUBDIRS) 7 | 8 | all: $(LIBFILES) 9 | @echo "Plugins build complete." 10 | @echo 11 | 12 | clean: $(SUBDIRS) 13 | @echo " [ RM ] $(LIBFILES)" 14 | @$(RM) $(LIBFILES) 15 | 16 | @echo 17 | @echo "Plugins source tree cleaned." 18 | @echo 19 | 20 | $(SUBDIRS): 21 | @echo " [ CD ] $(CURRENTPATH)$@/" 22 | @+make -C "$@" $(MAKECMDGOALS) 23 | 24 | %.a: $(SUBDIRS) 25 | @cp $*/$@ $@ -------------------------------------------------------------------------------- /src/demos/tsko/libs/Makefile: -------------------------------------------------------------------------------- 1 | # Sub directories to build 2 | SUBDIRS = $(patsubst %/,%,$(foreach subdir,$(wildcard */Makefile),$(dir $(subdir)))) 3 | LIBFILES = $(addsuffix .a,$(SUBDIRS)) 4 | 5 | .PHONY: all clean 6 | .PHONY: $(SUBDIRS) 7 | 8 | all: $(LIBFILES) 9 | @echo "Plugins build complete." 10 | @echo 11 | 12 | clean: $(SUBDIRS) 13 | @echo " [ RM ] $(LIBFILES)" 14 | @$(RM) $(LIBFILES) 15 | 16 | @echo 17 | @echo "Plugins source tree cleaned." 18 | @echo 19 | 20 | $(SUBDIRS): 21 | @echo " [ CD ] $(CURRENTPATH)$@/" 22 | @+make -C "$@" $(MAKECMDGOALS) 23 | 24 | %.a: $(SUBDIRS) 25 | @cp $*/$@ $@ -------------------------------------------------------------------------------- /src/demos/timer_test/libs/Makefile: -------------------------------------------------------------------------------- 1 | # Sub directories to build 2 | SUBDIRS = $(patsubst %/,%,$(foreach subdir,$(wildcard */Makefile),$(dir $(subdir)))) 3 | LIBFILES = $(addsuffix .a,$(SUBDIRS)) 4 | 5 | .PHONY: all clean 6 | .PHONY: $(SUBDIRS) 7 | 8 | all: $(LIBFILES) 9 | @echo "Plugins build complete." 10 | @echo 11 | 12 | clean: $(SUBDIRS) 13 | @echo " [ RM ] $(LIBFILES)" 14 | @$(RM) $(LIBFILES) 15 | 16 | @echo 17 | @echo "Plugins source tree cleaned." 18 | @echo 19 | 20 | $(SUBDIRS): 21 | @echo " [ CD ] $(CURRENTPATH)$@/" 22 | @+make -C "$@" $(MAKECMDGOALS) 23 | 24 | %.a: $(SUBDIRS) 25 | @cp $*/$@ $@ -------------------------------------------------------------------------------- /src/common/draw/include/draw/font.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAW_FONT_H_ 2 | #define DRAW_FONT_H_ 3 | 4 | #include "color.h" 5 | 6 | typedef struct DrawFont DrawFont; 7 | struct DrawFont { 8 | uint8_t *mem; 9 | unsigned int glyph_width; 10 | unsigned int glyph_height; 11 | }; 12 | 13 | DrawFont *draw_font_new(void *mem, unsigned int glyph_width, unsigned int glyph_height); 14 | void draw_font_free(DrawFont *font); 15 | int draw_font_string_geometrics(DrawFont *font, char *s, int max_line_w, int *text_w, int *text_h); 16 | int draw_font_glyph_h(DrawFont *font); 17 | int draw_font_string_w(DrawFont *font, char *s); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/misc/Makefile: -------------------------------------------------------------------------------- 1 | MAKEFLAGS += --no-print-directory 2 | 3 | hexload: 4 | m68k-elf-as -m68040 -o bootrom.elf hexload.s 5 | make bootrom.bin 6 | 7 | binload: 8 | m68k-elf-as -m68060 -o bootrom.elf bootrom.S 9 | #m68k-elf-as -m68060 -o bootrom.elf arne.s 10 | make bootrom.bin 11 | 12 | hexload-new: 13 | m68k-elf-as -m68040 -o bootrom.elf hexload-new.s 14 | make bootrom.bin 15 | 16 | bootrom.bin: bootrom.elf 17 | m68k-elf-objcopy -O binary bootrom.elf bootrom.bin 18 | xxd -g 4 -c 4 -p < bootrom.bin | tr "\n" ' ' 19 | @echo 20 | hexwrite ../../hdl/bootrom.hex record_width=4 word_size=4 input=bootrom.bin 21 | 22 | -------------------------------------------------------------------------------- /src/kbd/spi.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "protocol.h" 6 | 7 | void spi_init() { 8 | DDRB |= (1 << 4); //MISO output 9 | DDRB &= ~(1 << 3); //MOSI input 10 | DDRB &= ~(1 << 2); //SS input 11 | DDRB &= ~(1 << 5); //SCK input 12 | 13 | (void) SPDR; 14 | SPDR = 0xFF; 15 | SPCR = 0xC0; 16 | } 17 | 18 | void spi_deinit() { 19 | DDRB &= ~(1 << 4); //MISO input 20 | SPCR = 0x0; 21 | } 22 | 23 | void spi_send(uint8_t data) { 24 | SPDR = data; 25 | } 26 | 27 | uint8_t spi_recv() { 28 | return SPDR; 29 | } 30 | 31 | ISR(SPI_STC_vect) { 32 | protocol_tick(); 33 | } 34 | -------------------------------------------------------------------------------- /hw/motherboard/gerber/trollbook-rev2-Edge.Cuts.gm1: -------------------------------------------------------------------------------- 1 | G04 #@! TF.FileFunction,Profile,NP* 2 | %FSLAX46Y46*% 3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 4 | G04 Created by KiCad (PCBNEW 0.201602281447+6595~42~ubuntu14.04.1-product) date fre 4 mar 2016 01:41:54* 5 | %MOMM*% 6 | G01* 7 | G04 APERTURE LIST* 8 | %ADD10C,0.100000*% 9 | %ADD11C,0.150000*% 10 | G04 APERTURE END LIST* 11 | D10* 12 | D11* 13 | X185000000Y-50000000D02* 14 | X185000000Y-150000000D01* 15 | X85000000Y-50000000D02* 16 | X85000000Y-150000000D01* 17 | X85000000Y-150000000D02* 18 | X185000000Y-150000000D01* 19 | X85000000Y-50000000D02* 20 | X185000000Y-50000000D01* 21 | M02* 22 | -------------------------------------------------------------------------------- /src/common/draw/include/draw/utf8.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAW_UTF8_H_ 2 | #define DRAW_UTF8_H_ 3 | 4 | int draw_utf8_valid(const unsigned char *str); 5 | unsigned int draw_utf8_get_char(const char *str_s); 6 | int draw_utf8_char_length(const char *str_s); 7 | int draw_utf8_find_char_index(const char *str_s, unsigned int pos); 8 | const char *draw_utf8_find_start_by_char_pos(const char *str_s, unsigned int pos); 9 | int draw_utf8_counted_string_size(const char *str_s, unsigned int chars); 10 | int draw_utf8_chars_in_string(const char *str_s); 11 | int draw_utf8_encoded_length(unsigned int ch); 12 | int draw_utf8_encode(unsigned int ch, char *str_s, int buf_len); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/demos/bounce/link.ld: -------------------------------------------------------------------------------- 1 | _stack = 0x20000000; 2 | 3 | MEMORY { 4 | vram(rwx): ORIGIN = 0x80000, LENGTH = 384000 5 | bios(rwx): ORIGIN = 0xDDC00, LENGTH = 0x100 6 | stage2(rwx): ORIGIN = 0xDDD00, LENGTH = 0x19000 7 | sram(rwx): ORIGIN = 0xF6D00, LENGTH = 0x9300 8 | virtual(rwx): ORIGIN = 0x10000000, LENGTH = 128M 9 | dram(rwx): ORIGIN = 0x80000000, LENGTH = 64M 10 | } 11 | 12 | SECTIONS { 13 | .text : { 14 | *(.text) 15 | *(.rodata*) 16 | } > virtual 17 | 18 | .data ALIGN(4096): { 19 | *(.data) 20 | } 21 | 22 | .bss ALIGN(4096): { 23 | __bss_start = .; 24 | *(.bss) 25 | *(COMMON) 26 | __bss_end = .; 27 | } 28 | } 29 | 30 | ENTRY(_start) 31 | -------------------------------------------------------------------------------- /src/demos/modplay/link.ld: -------------------------------------------------------------------------------- 1 | _stack = 0x20000000; 2 | 3 | MEMORY { 4 | vram(rwx): ORIGIN = 0x80000, LENGTH = 384000 5 | bios(rwx): ORIGIN = 0xDDC00, LENGTH = 0x100 6 | stage2(rwx): ORIGIN = 0xDDD00, LENGTH = 0x19000 7 | sram(rwx): ORIGIN = 0xF6D00, LENGTH = 0x9300 8 | virtual(rwx): ORIGIN = 0x80000000, LENGTH = 128M 9 | dram(rwx): ORIGIN = 0x80000000, LENGTH = 64M 10 | } 11 | 12 | SECTIONS { 13 | .text : { 14 | *(.text) 15 | *(.rodata*) 16 | } > virtual 17 | 18 | .data ALIGN(4096): { 19 | *(.data) 20 | } 21 | 22 | .bss ALIGN(4096): { 23 | __bss_start = .; 24 | *(.bss) 25 | *(COMMON) 26 | __bss_end = .; 27 | } 28 | end = .; 29 | } 30 | 31 | ENTRY(_start) 32 | -------------------------------------------------------------------------------- /src/demos/trololo/link.ld: -------------------------------------------------------------------------------- 1 | _stack = 0x20000000; 2 | 3 | MEMORY { 4 | vram(rwx): ORIGIN = 0x80000, LENGTH = 384000 5 | bios(rwx): ORIGIN = 0xDDC00, LENGTH = 0x100 6 | stage2(rwx): ORIGIN = 0xDDD00, LENGTH = 0x19000 7 | sram(rwx): ORIGIN = 0xF6D00, LENGTH = 0x9300 8 | virtual(rwx): ORIGIN = 0x80000000, LENGTH = 128M 9 | dram(rwx): ORIGIN = 0x80000000, LENGTH = 64M 10 | } 11 | 12 | SECTIONS { 13 | .text : { 14 | *(.text) 15 | *(.rodata*) 16 | } > virtual 17 | 18 | .data ALIGN(4096): { 19 | *(.data) 20 | } 21 | 22 | .bss ALIGN(4096): { 23 | __bss_start = .; 24 | *(.bss) 25 | *(COMMON) 26 | __bss_end = .; 27 | } 28 | end = .; 29 | } 30 | 31 | ENTRY(_start) 32 | -------------------------------------------------------------------------------- /src/demos/tsko/link.ld: -------------------------------------------------------------------------------- 1 | _stack = 0x20000000; 2 | 3 | MEMORY { 4 | vram(rwx): ORIGIN = 0x80000, LENGTH = 384000 5 | bios(rwx): ORIGIN = 0xDDC00, LENGTH = 0x100 6 | stage2(rwx): ORIGIN = 0xDDD00, LENGTH = 0x19000 7 | sram(rwx): ORIGIN = 0xF6D00, LENGTH = 0x9300 8 | virtual(rwx): ORIGIN = 0x80000000, LENGTH = 128M 9 | dram(rwx): ORIGIN = 0x80000000, LENGTH = 64M 10 | } 11 | 12 | SECTIONS { 13 | .text : { 14 | *(.text) 15 | *(.rodata*) 16 | } > virtual 17 | 18 | .data ALIGN(4096): { 19 | *(.data) 20 | } 21 | 22 | .bss ALIGN(4096): { 23 | __bss_start = .; 24 | *(.bss) 25 | *(COMMON) 26 | __bss_end = .; 27 | } 28 | end = .; 29 | } 30 | 31 | ENTRY(_start) 32 | -------------------------------------------------------------------------------- /src/common/draw/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) 6 | 7 | OUTFILE = out.a 8 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 9 | 10 | 11 | .PHONY: all clean 12 | .PHONY: $(SUBDIRS) 13 | .SUFFIXES: 14 | 15 | all: $(AFILE) 16 | @echo "Build complete." 17 | @echo 18 | 19 | clean: $(SUBDIRS) 20 | @echo " [ RM ] $(AFILE)" 21 | @$(RM) $(AFILE) 22 | 23 | $(AFILE): $(SUBDIRS) 24 | @echo " [ AR ] $(CURRENTPATH)$(AFILE)" 25 | @$(RM) $(AFILE) 26 | @$(AR) -cm $(AFILE) $(shell $(AR) t $(LIBS)) 27 | 28 | $(SUBDIRS): 29 | @echo " [ CD ] $(CURRENTPATH)$@/" 30 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 31 | -------------------------------------------------------------------------------- /src/common/file-io/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) 6 | 7 | OUTFILE = out.a 8 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 9 | 10 | 11 | .PHONY: all clean 12 | .PHONY: $(SUBDIRS) 13 | .SUFFIXES: 14 | 15 | all: $(AFILE) 16 | @echo "Build complete." 17 | @echo 18 | 19 | clean: $(SUBDIRS) 20 | @echo " [ RM ] $(AFILE)" 21 | @$(RM) $(AFILE) 22 | 23 | $(AFILE): $(SUBDIRS) 24 | @echo " [ AR ] $(CURRENTPATH)$(AFILE)" 25 | @$(RM) $(AFILE) 26 | @$(AR) -cm $(AFILE) $(shell $(AR) t $(LIBS)) 27 | 28 | $(SUBDIRS): 29 | @echo " [ CD ] $(CURRENTPATH)$@/" 30 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 31 | -------------------------------------------------------------------------------- /src/common/muil/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) 6 | 7 | OUTFILE = out.a 8 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 9 | 10 | 11 | .PHONY: all clean 12 | .PHONY: $(SUBDIRS) 13 | .SUFFIXES: 14 | 15 | all: $(AFILE) 16 | @echo "Build complete." 17 | @echo 18 | 19 | clean: $(SUBDIRS) 20 | @echo " [ RM ] $(AFILE)" 21 | @$(RM) $(AFILE) 22 | 23 | $(AFILE): $(SUBDIRS) 24 | @echo " [ AR ] $(CURRENTPATH)$(AFILE)" 25 | @$(RM) $(AFILE) 26 | @$(AR) -cm $(AFILE) $(shell $(AR) t $(LIBS)) 27 | 28 | $(SUBDIRS): 29 | @echo " [ CD ] $(CURRENTPATH)$@/" 30 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 31 | -------------------------------------------------------------------------------- /src/common/sound/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) 6 | 7 | OUTFILE = out.a 8 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 9 | 10 | 11 | .PHONY: all clean 12 | .PHONY: $(SUBDIRS) 13 | .SUFFIXES: 14 | 15 | all: $(AFILE) 16 | @echo "Build complete." 17 | @echo 18 | 19 | clean: $(SUBDIRS) 20 | @echo " [ RM ] $(AFILE)" 21 | @$(RM) $(AFILE) 22 | 23 | $(AFILE): $(SUBDIRS) 24 | @echo " [ AR ] $(CURRENTPATH)$(AFILE)" 25 | @$(RM) $(AFILE) 26 | @$(AR) -cm $(AFILE) $(shell $(AR) t $(LIBS)) 27 | 28 | $(SUBDIRS): 29 | @echo " [ CD ] $(CURRENTPATH)$@/" 30 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 31 | -------------------------------------------------------------------------------- /src/common/ungzip/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) 6 | 7 | OUTFILE = out.a 8 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 9 | 10 | 11 | .PHONY: all clean 12 | .PHONY: $(SUBDIRS) 13 | .SUFFIXES: 14 | 15 | all: $(AFILE) 16 | @echo "Build complete." 17 | @echo 18 | 19 | clean: $(SUBDIRS) 20 | @echo " [ RM ] $(AFILE)" 21 | @$(RM) $(AFILE) 22 | 23 | $(AFILE): $(SUBDIRS) 24 | @echo " [ AR ] $(CURRENTPATH)$(AFILE)" 25 | @$(RM) $(AFILE) 26 | @$(AR) -cm $(AFILE) $(shell $(AR) t $(LIBS)) 27 | 28 | $(SUBDIRS): 29 | @echo " [ CD ] $(CURRENTPATH)$@/" 30 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 31 | -------------------------------------------------------------------------------- /src/common/util/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) 6 | 7 | OUTFILE = out.a 8 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 9 | 10 | 11 | .PHONY: all clean 12 | .PHONY: $(SUBDIRS) 13 | .SUFFIXES: 14 | 15 | all: $(AFILE) 16 | @echo "Build complete." 17 | @echo 18 | 19 | clean: $(SUBDIRS) 20 | @echo " [ RM ] $(AFILE)" 21 | @$(RM) $(AFILE) 22 | 23 | $(AFILE): $(SUBDIRS) 24 | @echo " [ AR ] $(CURRENTPATH)$(AFILE)" 25 | @$(RM) $(AFILE) 26 | @$(AR) -cm $(AFILE) $(shell $(AR) t $(LIBS)) 27 | 28 | $(SUBDIRS): 29 | @echo " [ CD ] $(CURRENTPATH)$@/" 30 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 31 | -------------------------------------------------------------------------------- /src/demos/timer_test/link.ld: -------------------------------------------------------------------------------- 1 | _stack = 0x20000000; 2 | 3 | MEMORY { 4 | vram(rwx): ORIGIN = 0x80000, LENGTH = 384000 5 | bios(rwx): ORIGIN = 0xDDC00, LENGTH = 0x100 6 | stage2(rwx): ORIGIN = 0xDDD00, LENGTH = 0x19000 7 | sram(rwx): ORIGIN = 0xF6D00, LENGTH = 0x9300 8 | virtual(rwx): ORIGIN = 0x80000000, LENGTH = 128M 9 | dram(rwx): ORIGIN = 0x80000000, LENGTH = 64M 10 | } 11 | 12 | SECTIONS { 13 | .text : { 14 | *(.text) 15 | *(.rodata*) 16 | } > virtual 17 | 18 | .data ALIGN(4096): { 19 | *(.data) 20 | } 21 | 22 | .bss ALIGN(4096): { 23 | __bss_start = .; 24 | *(.bss) 25 | *(COMMON) 26 | __bss_end = .; 27 | } 28 | end = .; 29 | } 30 | 31 | ENTRY(_start) 32 | -------------------------------------------------------------------------------- /src/common/lz4inflate/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) 6 | 7 | OUTFILE = out.a 8 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 9 | 10 | 11 | .PHONY: all clean 12 | .PHONY: $(SUBDIRS) 13 | .SUFFIXES: 14 | 15 | all: $(AFILE) 16 | @echo "Build complete." 17 | @echo 18 | 19 | clean: $(SUBDIRS) 20 | @echo " [ RM ] $(AFILE)" 21 | @$(RM) $(AFILE) 22 | 23 | $(AFILE): $(SUBDIRS) 24 | @echo " [ AR ] $(CURRENTPATH)$(AFILE)" 25 | @$(RM) $(AFILE) 26 | @$(AR) -cm $(AFILE) $(shell $(AR) t $(LIBS)) 27 | 28 | $(SUBDIRS): 29 | @echo " [ CD ] $(CURRENTPATH)$@/" 30 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 31 | -------------------------------------------------------------------------------- /src/common/peripheral/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) 6 | 7 | OUTFILE = out.a 8 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 9 | 10 | 11 | .PHONY: all clean 12 | .PHONY: $(SUBDIRS) 13 | .SUFFIXES: 14 | 15 | all: $(AFILE) 16 | @echo "Build complete." 17 | @echo 18 | 19 | clean: $(SUBDIRS) 20 | @echo " [ RM ] $(AFILE)" 21 | @$(RM) $(AFILE) 22 | 23 | $(AFILE): $(SUBDIRS) 24 | @echo " [ AR ] $(CURRENTPATH)$(AFILE)" 25 | @$(RM) $(AFILE) 26 | @$(AR) -cm $(AFILE) $(shell $(AR) t $(LIBS)) 27 | 28 | $(SUBDIRS): 29 | @echo " [ CD ] $(CURRENTPATH)$@/" 30 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 31 | -------------------------------------------------------------------------------- /src/common/terminal/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) 6 | 7 | OUTFILE = out.a 8 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 9 | 10 | 11 | .PHONY: all clean 12 | .PHONY: $(SUBDIRS) 13 | .SUFFIXES: 14 | 15 | all: $(AFILE) 16 | @echo "Build complete." 17 | @echo 18 | 19 | clean: $(SUBDIRS) 20 | @echo " [ RM ] $(AFILE)" 21 | @$(RM) $(AFILE) 22 | 23 | $(AFILE): $(SUBDIRS) 24 | @echo " [ AR ] $(CURRENTPATH)$(AFILE)" 25 | @$(RM) $(AFILE) 26 | @$(AR) -cm $(AFILE) $(shell $(AR) t $(LIBS)) 27 | 28 | $(SUBDIRS): 29 | @echo " [ CD ] $(CURRENTPATH)$@/" 30 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 31 | -------------------------------------------------------------------------------- /hw/display-board/lib/s25fl204k0tmfi010.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # S25FL204K0TMFI010 5 | # 6 | DEF S25FL204K0TMFI010 U 0 40 Y Y 1 F N 7 | F0 "U" 0 200 60 H V C CNN 8 | F1 "S25FL204K0TMFI010" 50 400 60 H V C CNN 9 | F2 "" 0 0 60 H V C CNN 10 | F3 "" 0 0 60 H V C CNN 11 | DRAW 12 | S -750 700 800 -150 0 1 0 N 13 | X ~CS 1 1000 100 200 L 50 50 1 1 I 14 | X MISO 2 1000 400 200 L 50 50 1 1 O 15 | X ~WP 3 -950 400 200 R 50 50 1 1 I 16 | X GND 4 0 -350 200 U 50 50 1 1 W 17 | X MOSI 5 1000 300 200 L 50 50 1 1 I 18 | X SCK 6 1000 200 200 L 50 50 1 1 I 19 | X ~HOLD 7 -950 300 200 R 50 50 1 1 I 20 | X VCC 8 0 900 200 D 50 50 1 1 W 21 | ENDDRAW 22 | ENDDEF 23 | # 24 | #End Library 25 | -------------------------------------------------------------------------------- /hw/motherboard/lib/s25fl204k0tmfi010.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # S25FL204K0TMFI010 5 | # 6 | DEF S25FL204K0TMFI010 U 0 40 Y Y 1 F N 7 | F0 "U" 0 200 60 H V C CNN 8 | F1 "S25FL204K0TMFI010" 50 400 60 H V C CNN 9 | F2 "" 0 0 60 H V C CNN 10 | F3 "" 0 0 60 H V C CNN 11 | DRAW 12 | S -750 700 800 -150 0 1 0 N 13 | X ~CS 1 1000 100 200 L 50 50 1 1 I 14 | X MISO 2 1000 400 200 L 50 50 1 1 O 15 | X ~WP 3 -950 400 200 R 50 50 1 1 I 16 | X GND 4 0 -350 200 U 50 50 1 1 W 17 | X MOSI 5 1000 300 200 L 50 50 1 1 I 18 | X SCK 6 1000 200 200 L 50 50 1 1 I 19 | X ~HOLD 7 -950 300 200 R 50 50 1 1 I 20 | X VCC 8 0 900 200 D 50 50 1 1 W 21 | ENDDRAW 22 | ENDDEF 23 | # 24 | #End Library 25 | -------------------------------------------------------------------------------- /src/common/draw/include/draw/text.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAW_TEXT_H_ 2 | #define DRAW_TEXT_H_ 3 | 4 | #include 5 | #include "font.h" 6 | 7 | typedef struct DrawTextSurface DrawTextSurface; 8 | struct DrawTextSurface { 9 | DrawFont *font; 10 | int x; 11 | int y; 12 | size_t bufsiz; 13 | char *buf; 14 | unsigned int linelen; 15 | }; 16 | 17 | DrawTextSurface *draw_text_surface_new(DrawFont *font, size_t bufsiz, unsigned int linelen, int x, int y); 18 | void draw_text_surface_free(DrawTextSurface *surface); 19 | void draw_text_surface_draw(DrawTextSurface *surface); 20 | void draw_text_surface_string_append(DrawTextSurface *surface, char *s); 21 | void draw_text_surface_reset(DrawTextSurface *surface); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/common/draw/include/draw/rect.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAW_RECT_H_ 2 | #define DRAW_RECT_H_ 3 | 4 | #include 5 | 6 | typedef struct DrawRect DrawRect; 7 | struct DrawRect { 8 | int x1; 9 | int y1; 10 | int x2; 11 | int y2; 12 | }; 13 | 14 | typedef struct DrawRectSet DrawRectSet; 15 | struct DrawRectSet { 16 | DrawRect *rect; 17 | size_t rects; 18 | }; 19 | 20 | DrawRectSet *draw_rect_set_new(size_t rects); 21 | void draw_rect_set_move(DrawRectSet *set, size_t rect, int x1, int y1, int x2, int y2); 22 | void draw_rect_set_get(DrawRectSet *set, size_t rect, int *x1, int *y1, int *x2, int *y2); 23 | void draw_rect_set_draw(DrawRectSet *set, size_t rects); 24 | void draw_rect_set_free(DrawRectSet *set); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /hw/peripheral-board/battery-rescue.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # CONN_01X03-RESCUE-battery 5 | # 6 | DEF CONN_01X03-RESCUE-battery J 0 40 Y N 1 F N 7 | F0 "J" 0 200 50 H V C CNN 8 | F1 "CONN_01X03-RESCUE-battery" 100 0 50 V V C CNN 9 | F2 "" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | Pin_Header_Straight_1X* 13 | Pin_Header_Angled_1X* 14 | Socket_Strip_Straight_1X* 15 | Socket_Strip_Angled_1X* 16 | $ENDFPLIST 17 | DRAW 18 | S -50 -95 10 -105 0 1 0 N 19 | S -50 5 10 -5 0 1 0 N 20 | S -50 105 10 95 0 1 0 N 21 | S -50 150 50 -150 0 1 0 N 22 | X P1 1 -200 100 150 R 50 50 1 1 P 23 | X P2 2 -200 0 150 R 50 50 1 1 P 24 | X P3 3 -200 -100 150 R 50 50 1 1 P 25 | ENDDRAW 26 | ENDDEF 27 | # 28 | #End Library 29 | -------------------------------------------------------------------------------- /hw/peripheral-board/battery-rescue.lib.v4: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # CONN_01X03-RESCUE-battery 5 | # 6 | DEF CONN_01X03-RESCUE-battery J 0 40 Y N 1 F N 7 | F0 "J" 0 200 50 H V C CNN 8 | F1 "CONN_01X03-RESCUE-battery" 100 0 50 V V C CNN 9 | F2 "" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | Pin_Header_Straight_1X* 13 | Pin_Header_Angled_1X* 14 | Socket_Strip_Straight_1X* 15 | Socket_Strip_Angled_1X* 16 | $ENDFPLIST 17 | DRAW 18 | S -50 -95 10 -105 0 1 0 N 19 | S -50 5 10 -5 0 1 0 N 20 | S -50 105 10 95 0 1 0 N 21 | S -50 150 50 -150 0 1 0 N 22 | X P1 1 -200 100 150 R 50 50 1 1 P 23 | X P2 2 -200 0 150 R 50 50 1 1 P 24 | X P3 3 -200 -100 150 R 50 50 1 1 P 25 | ENDDRAW 26 | ENDDEF 27 | # 28 | #End Library 29 | -------------------------------------------------------------------------------- /hdl/reset.vhd: -------------------------------------------------------------------------------- 1 | library ieee; 2 | use ieee.std_logic_1164.all; 3 | 4 | entity reset is 5 | port( 6 | clk : in std_logic; 7 | pwron_reset : in std_logic; 8 | reset : out std_logic 9 | ); 10 | end reset; 11 | 12 | architecture arch of reset is 13 | --constant reset_cycles : integer := 1000000; --production value 14 | constant reset_cycles : integer := 100; --simulation value 15 | 16 | signal state : integer range 0 to reset_cycles + 1; 17 | begin 18 | process(pwron_reset, clk) is begin 19 | if pwron_reset = '0' then 20 | state <= 0; 21 | elsif falling_edge(clk) then 22 | if(state /= reset_cycles) then 23 | state <= state + 1; 24 | end if; 25 | end if; 26 | end process; 27 | 28 | reset <= '0' when state = reset_cycles else '1'; 29 | end arch; 30 | -------------------------------------------------------------------------------- /src/common/peripheral/include/spi.h: -------------------------------------------------------------------------------- 1 | #ifndef _SPI_H_ 2 | #define _SPI_H_ 3 | #include 4 | #include "peripheral.h" 5 | 6 | #define SPI_REG_DATA *((volatile uint32_t *) (PERIPHERAL_SPI_BASE + 0x0)) 7 | #define SPI_REG_STATUS *((volatile uint32_t *) (PERIPHERAL_SPI_BASE + 0x4)) 8 | #define SPI_REG_SS *((volatile uint32_t *) (PERIPHERAL_SPI_BASE + 0x8)) 9 | 10 | typedef enum SpiSlave SpiSlave; 11 | 12 | enum SpiSlave { 13 | SPI_SLAVE_NONE, 14 | SPI_SLAVE_ROM, 15 | SPI_SLAVE_KBD, 16 | SPI_SLAVE_SD, 17 | SPI_SLAVE_EXT0, 18 | SPI_SLAVE_EXT1, 19 | SPI_SLAVE_EXT2, 20 | SPI_SLAVE_EXT3, 21 | }; 22 | 23 | void spi_select_slave(int slave); 24 | uint8_t spi_send_recv(uint8_t dat); 25 | void spi_set_clockdiv(uint16_t clkdiv); 26 | uint16_t spi_get_clockdiv(); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /hw/motherboard/trollbook-rev2.pro: -------------------------------------------------------------------------------- 1 | update=fre 12 jan 2018 09:36:36 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | -------------------------------------------------------------------------------- /src/common/draw/config.mk: -------------------------------------------------------------------------------- 1 | # Name of the output file 2 | NAME = draw 3 | 4 | AFILE = $(NAME).a 5 | 6 | # Tools 7 | TARGET = m68k-elf- 8 | CC = $(TARGET)gcc 9 | AS = $(TARGET)as 10 | LD = $(TARGET)ld 11 | AR = $(TARGET)ar 12 | SREC_CAT = srec_cat 13 | 14 | # Paths 15 | MODULESDIR = $(TOPDIR)/libs 16 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 17 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 18 | 19 | INCLUDEDIRS = $(TOPDIR)/include $(MODULESINCLUDE) 20 | 21 | # Compiler and linker flags 22 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 23 | 24 | CFLAGS = -Wall -Os -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 25 | ASFLAGS = -msoft-float 26 | 27 | # Makefile configurations 28 | MAKEFLAGS += --no-print-directory 29 | -------------------------------------------------------------------------------- /src/common/draw/include/draw/line.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAW_LINE_H_ 2 | #define DRAW_LINE_H_ 3 | 4 | #include 5 | 6 | typedef struct DrawLine DrawLine; 7 | struct DrawLine { 8 | int x1; 9 | int y1; 10 | int x2; 11 | int y2; 12 | unsigned int thickness; 13 | }; 14 | 15 | typedef struct DrawLineSet DrawLineSet; 16 | struct DrawLineSet { 17 | DrawLine *line; 18 | size_t lines; 19 | unsigned int thickness; 20 | }; 21 | 22 | DrawLineSet *draw_line_set_new(size_t lines, unsigned int thickness); 23 | void draw_line_set_move(DrawLineSet *set, size_t line, int x1, int y1, int x2, int y2); 24 | void draw_line_set_get(DrawLineSet *set, size_t line, int *x1, int *y1, int *x2, int *y2); 25 | void draw_line_set_draw(DrawLineSet *set, size_t lines); 26 | void draw_line_set_free(DrawLineSet *set); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/common/muil/config.mk: -------------------------------------------------------------------------------- 1 | # Name of the output file 2 | NAME = muil 3 | 4 | AFILE = $(NAME).a 5 | 6 | # Tools 7 | TARGET = m68k-elf- 8 | CC = $(TARGET)gcc 9 | AS = $(TARGET)as 10 | LD = $(TARGET)ld 11 | AR = $(TARGET)ar 12 | SREC_CAT = srec_cat 13 | 14 | # Paths 15 | MODULESDIR = $(TOPDIR)/libs 16 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 17 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 18 | 19 | INCLUDEDIRS = $(TOPDIR)/include $(MODULESINCLUDE) 20 | 21 | # Compiler and linker flags 22 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 23 | 24 | CFLAGS = -Wall -Os -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 25 | ASFLAGS = -msoft-float 26 | 27 | # Makefile configurations 28 | MAKEFLAGS += --no-print-directory 29 | -------------------------------------------------------------------------------- /src/common/peripheral/include/sd.h: -------------------------------------------------------------------------------- 1 | #ifndef __SD_H__ 2 | 3 | #define SD_BLOCK_SIZE 512 4 | 5 | typedef enum { 6 | SD_CARD_TYPE_INVALID = -1, 7 | SD_CARD_TYPE_MMC, 8 | SD_CARD_TYPE_SD, 9 | SD_CARD_TYPE_SDHC, 10 | } SDCardType; 11 | 12 | enum { 13 | SD_STREAM_STATUS_FAILED= -2, 14 | SD_STREAM_STATUS_BEGIN = -1, 15 | SD_STREAM_STATUS_DONE, 16 | }; 17 | 18 | typedef int SDStreamStatus; 19 | 20 | SDCardType sd_init(void); 21 | void sd_send_command(uint8_t command, uint32_t arg); 22 | SDCardType sd_poll(void); 23 | uint32_t sd_get_card_size(void); 24 | int16_t sd_recv(void); 25 | uint8_t sd_stream_read_block(SDStreamStatus *status, ...); 26 | void sd_stream_write_block(SDStreamStatus *status, ...); 27 | void sd_stream_write_multiple(SDStreamStatus *status, ...); 28 | SDCardType sd_get_type(); 29 | #endif 30 | -------------------------------------------------------------------------------- /src/common/sound/config.mk: -------------------------------------------------------------------------------- 1 | # Name of the output file 2 | NAME = sound 3 | 4 | AFILE = $(NAME).a 5 | 6 | # Tools 7 | TARGET = m68k-elf- 8 | CC = $(TARGET)gcc 9 | AS = $(TARGET)as 10 | LD = $(TARGET)ld 11 | AR = $(TARGET)ar 12 | SREC_CAT = srec_cat 13 | 14 | # Paths 15 | MODULESDIR = $(TOPDIR)/libs 16 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 17 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 18 | 19 | INCLUDEDIRS = $(TOPDIR)/include $(MODULESINCLUDE) 20 | 21 | # Compiler and linker flags 22 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 23 | 24 | CFLAGS = -Wall -Os -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 25 | ASFLAGS = -msoft-float 26 | 27 | # Makefile configurations 28 | MAKEFLAGS += --no-print-directory 29 | -------------------------------------------------------------------------------- /src/common/util/config.mk: -------------------------------------------------------------------------------- 1 | # Name of the output file 2 | NAME = util 3 | 4 | AFILE = $(NAME).a 5 | 6 | # Tools 7 | TARGET = m68k-elf- 8 | CC = $(TARGET)gcc 9 | AS = $(TARGET)as 10 | LD = $(TARGET)ld 11 | AR = $(TARGET)ar 12 | SREC_CAT = srec_cat 13 | 14 | # Paths 15 | MODULESDIR = $(TOPDIR)/libs 16 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 17 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 18 | 19 | INCLUDEDIRS = $(TOPDIR)/include $(MODULESINCLUDE) 20 | 21 | # Compiler and linker flags 22 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 23 | 24 | CFLAGS = -Wall -Os -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 25 | ASFLAGS = -msoft-float 26 | 27 | # Makefile configurations 28 | MAKEFLAGS += --no-print-directory 29 | -------------------------------------------------------------------------------- /hw/peripheral-board/battery.pro: -------------------------------------------------------------------------------- 1 | update=fre 12 jan 2018 09:39:22 2 | version=1 3 | last_client=eeschema 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | -------------------------------------------------------------------------------- /src/common/file-io/config.mk: -------------------------------------------------------------------------------- 1 | # Name of the output file 2 | NAME = file-io 3 | 4 | AFILE = $(NAME).a 5 | 6 | # Tools 7 | TARGET = m68k-elf- 8 | CC = $(TARGET)gcc 9 | AS = $(TARGET)as 10 | LD = $(TARGET)ld 11 | AR = $(TARGET)ar 12 | SREC_CAT = srec_cat 13 | 14 | # Paths 15 | MODULESDIR = $(TOPDIR)/libs 16 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 17 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 18 | 19 | INCLUDEDIRS = $(TOPDIR)/include $(MODULESINCLUDE) 20 | 21 | # Compiler and linker flags 22 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 23 | 24 | CFLAGS = -Wall -Os -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 25 | ASFLAGS = -msoft-float 26 | 27 | # Makefile configurations 28 | MAKEFLAGS += --no-print-directory 29 | -------------------------------------------------------------------------------- /src/common/ungzip/config.mk: -------------------------------------------------------------------------------- 1 | # Name of the output file 2 | NAME = ungzip 3 | 4 | AFILE = $(NAME).a 5 | 6 | # Tools 7 | TARGET = m68k-elf- 8 | CC = $(TARGET)gcc 9 | AS = $(TARGET)as 10 | LD = $(TARGET)ld 11 | AR = $(TARGET)ar 12 | SREC_CAT = srec_cat 13 | 14 | # Paths 15 | MODULESDIR = $(TOPDIR)/libs 16 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 17 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 18 | 19 | INCLUDEDIRS = $(TOPDIR)/include $(MODULESINCLUDE) 20 | 21 | # Compiler and linker flags 22 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 23 | 24 | CFLAGS = -Wall -Os -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 25 | ASFLAGS = -msoft-float 26 | 27 | # Makefile configurations 28 | MAKEFLAGS += --no-print-directory 29 | -------------------------------------------------------------------------------- /hw/peripheral-board/peripheral-board.pro: -------------------------------------------------------------------------------- 1 | update=fre 12 jan 2018 09:44:56 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | -------------------------------------------------------------------------------- /hw/peripheral-board/peripheral-board.pro.v4: -------------------------------------------------------------------------------- 1 | update=fre 12 jan 2018 09:43:50 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | -------------------------------------------------------------------------------- /src/common/lz4inflate/config.mk: -------------------------------------------------------------------------------- 1 | # Name of the output file 2 | NAME = lz4inflate 3 | 4 | AFILE = $(NAME).a 5 | 6 | # Tools 7 | TARGET = m68k-elf- 8 | CC = $(TARGET)gcc 9 | AS = $(TARGET)as 10 | LD = $(TARGET)ld 11 | AR = $(TARGET)ar 12 | SREC_CAT = srec_cat 13 | 14 | # Paths 15 | MODULESDIR = $(TOPDIR)/libs 16 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 17 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 18 | 19 | INCLUDEDIRS = $(TOPDIR)/include $(MODULESINCLUDE) 20 | 21 | # Compiler and linker flags 22 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 23 | 24 | CFLAGS = -Wall -Os -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 25 | ASFLAGS = -msoft-float 26 | 27 | # Makefile configurations 28 | MAKEFLAGS += --no-print-directory 29 | -------------------------------------------------------------------------------- /src/common/peripheral/config.mk: -------------------------------------------------------------------------------- 1 | # Name of the output file 2 | NAME = peripheral 3 | 4 | AFILE = $(NAME).a 5 | 6 | # Tools 7 | TARGET = m68k-elf- 8 | CC = $(TARGET)gcc 9 | AS = $(TARGET)as 10 | LD = $(TARGET)ld 11 | AR = $(TARGET)ar 12 | SREC_CAT = srec_cat 13 | 14 | # Paths 15 | MODULESDIR = $(TOPDIR)/libs 16 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 17 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 18 | 19 | INCLUDEDIRS = $(TOPDIR)/include $(MODULESINCLUDE) 20 | 21 | # Compiler and linker flags 22 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 23 | 24 | CFLAGS = -Wall -Os -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 25 | ASFLAGS = -msoft-float 26 | 27 | # Makefile configurations 28 | MAKEFLAGS += --no-print-directory 29 | -------------------------------------------------------------------------------- /src/common/terminal/config.mk: -------------------------------------------------------------------------------- 1 | # Name of the output file 2 | NAME = terminal 3 | 4 | AFILE = $(NAME).a 5 | 6 | # Tools 7 | TARGET = m68k-elf- 8 | CC = $(TARGET)gcc 9 | AS = $(TARGET)as 10 | LD = $(TARGET)ld 11 | AR = $(TARGET)ar 12 | SREC_CAT = srec_cat 13 | 14 | # Paths 15 | MODULESDIR = $(TOPDIR)/libs 16 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 17 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 18 | 19 | INCLUDEDIRS = $(TOPDIR)/include $(MODULESINCLUDE) 20 | 21 | # Compiler and linker flags 22 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 23 | 24 | CFLAGS = -Wall -Os -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 25 | ASFLAGS = -msoft-float 26 | 27 | # Makefile configurations 28 | MAKEFLAGS += --no-print-directory 29 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/digital-pot.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # MCP4011 5 | # 6 | DEF MCP4011 U 0 40 Y Y 1 F N 7 | F0 "U" 0 50 60 H V C CNN 8 | F1 "MCP4011" 0 -50 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | DRAW 12 | S -550 300 550 -300 0 1 0 N 13 | P 2 0 1 0 300 0 325 -25 N 14 | P 2 0 1 0 325 25 300 0 N 15 | P 2 0 1 0 425 0 300 0 N 16 | P 3 0 1 0 275 -75 275 -100 425 -100 N 17 | P 8 0 1 0 425 100 275 100 275 75 250 75 250 -75 300 -75 300 75 275 75 N 18 | X VDD 1 0 500 200 D 50 50 1 1 W 19 | X VSS 2 0 -500 200 U 50 50 1 1 W 20 | X A 3 750 100 200 L 50 50 1 1 P 21 | X W 4 750 0 200 L 50 50 1 1 P 22 | X ~CS 5 -750 -50 200 R 50 50 1 1 I 23 | X B 6 750 -100 200 L 50 50 1 1 P 24 | X U/~D 8 -750 50 200 R 50 50 1 1 I 25 | ENDDRAW 26 | ENDDEF 27 | # 28 | #End Library 29 | -------------------------------------------------------------------------------- /hw/peripheral-board/out/battery/battery-Edge.Cuts.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,no-vcs-found-2f9be81~58~ubuntu16.04.1* 2 | G04 #@! TF.CreationDate,2017-04-06T12:37:07+02:00* 3 | G04 #@! TF.ProjectId,battery,626174746572792E6B696361645F7063,rev?* 4 | G04 #@! TF.FileFunction,Profile,NP* 5 | %FSLAX46Y46*% 6 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 7 | G04 Created by KiCad (PCBNEW no-vcs-found-2f9be81~58~ubuntu16.04.1) date Thu Apr 6 12:37:07 2017* 8 | %MOMM*% 9 | %LPD*% 10 | G01* 11 | G04 APERTURE LIST* 12 | %ADD10C,0.050000*% 13 | %ADD11C,0.100000*% 14 | G04 APERTURE END LIST* 15 | D10* 16 | D11* 17 | X0Y0D02* 18 | X0Y0D01* 19 | X50000000Y0D02* 20 | X0Y0D01* 21 | X50000000Y10000000D02* 22 | X50000000Y0D01* 23 | X0Y10000000D02* 24 | X50000000Y10000000D01* 25 | X0Y0D02* 26 | X0Y10000000D01* 27 | M02* 28 | -------------------------------------------------------------------------------- /hw/motherboard/lib/osc.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # VCC1-B3B 5 | # 6 | DEF VCC1-B3B U 0 40 Y Y 1 F N 7 | F0 "U" 0 -50 60 H V C CNN 8 | F1 "VCC1-B3B" 0 50 60 H V C CNN 9 | F2 "" -50 0 60 H V C CNN 10 | F3 "" -50 0 60 H V C CNN 11 | DRAW 12 | S -550 400 550 -400 0 1 0 N 13 | X E/~D 1 -750 0 200 R 50 50 1 1 I 14 | X GND 2 0 -600 200 U 50 50 1 1 W 15 | X CLKOUT 3 750 0 200 L 50 50 1 1 O 16 | X VCC 4 0 600 200 D 50 50 1 1 W 17 | ENDDRAW 18 | ENDDEF 19 | # 20 | # osc 21 | # 22 | DEF osc U 0 40 Y Y 1 F N 23 | F0 "U" -150 -50 60 H V C CNN 24 | F1 "osc" -150 50 60 H V C CNN 25 | F2 "" 0 -50 60 H V C CNN 26 | F3 "" 0 -50 60 H V C CNN 27 | DRAW 28 | S 250 300 -250 -300 0 1 0 N 29 | X GND 7 0 -500 200 U 50 50 1 1 W 30 | X CLK 8 450 0 200 L 50 50 1 1 O 31 | X VCC 14 0 500 200 D 50 50 1 1 W 32 | ENDDRAW 33 | ENDDEF 34 | # 35 | #End Library 36 | -------------------------------------------------------------------------------- /hw/display-board/lib/osc.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # VCC1-B3B 5 | # 6 | DEF VCC1-B3B U 0 40 Y Y 1 F N 7 | F0 "U" 0 -50 60 H V C CNN 8 | F1 "VCC1-B3B" 0 50 60 H V C CNN 9 | F2 "" -50 0 60 H V C CNN 10 | F3 "" -50 0 60 H V C CNN 11 | DRAW 12 | S -550 400 550 -400 0 1 0 N 13 | X E/~D 1 -750 0 200 R 50 50 1 1 I 14 | X GND 2 0 -600 200 U 50 50 1 1 W 15 | X CLKOUT 3 750 0 200 L 50 50 1 1 O 16 | X VCC 4 0 600 200 D 50 50 1 1 W 17 | ENDDRAW 18 | ENDDEF 19 | # 20 | # osc 21 | # 22 | DEF osc U 0 40 Y Y 1 F N 23 | F0 "U" -150 -50 60 H V C CNN 24 | F1 "osc" -150 50 60 H V C CNN 25 | F2 "" 0 -50 60 H V C CNN 26 | F3 "" 0 -50 60 H V C CNN 27 | DRAW 28 | S 250 300 -250 -300 0 1 0 N 29 | X GND 7 0 -500 200 U 50 50 1 1 W 30 | X CLK 8 450 0 200 L 50 50 1 1 O 31 | X VCC 14 0 500 200 D 50 50 1 1 W 32 | ENDDRAW 33 | ENDDEF 34 | # 35 | #End Library 36 | -------------------------------------------------------------------------------- /src/misc/arne.s: -------------------------------------------------------------------------------- 1 | #NO_APP 2 | .text 3 | .int 0x00100000 4 | .int 0x00000008 5 | 6 | main: 7 | clr.l %d0 8 | .L2: 9 | move.l %d0,%d3 10 | lsr.l #3,%d3 11 | move.l %d0,%d1 12 | muls.l #800,%d1 13 | move.l %d1,%a0 14 | clr.l %d1 15 | .L7: 16 | move.l %d1,%d2 17 | or.l %d0,%d2 18 | move.w %d2,%ccr 19 | jpl .L3 20 | clr.w 524288(%a0) 21 | jra .L4 22 | .L3: 23 | move.l %d1,%d2 24 | asr.l #3,%d2 25 | or.w %d3,%d2 26 | move.w %d2,%d4 27 | lsl.w #8,%d4 28 | or.w %d2,%d4 29 | move.w %d4,524288(%a0) 30 | .L4: 31 | addq.l #1,%d1 32 | addq.l #2,%a0 33 | cmp.l #400,%d1 34 | jne .L7 35 | addq.l #1,%d0 36 | cmp.l #480,%d0 37 | jne .L2 38 | 39 | 2: lpstop #0x3000 40 | bra 2b 41 | -------------------------------------------------------------------------------- /src/stage2/src/stage2.S: -------------------------------------------------------------------------------- 1 | .global _start 2 | _start: 3 | lea __bss_start, %a0 4 | lea __bss_end, %a1 5 | 6 | 1: 7 | cmp.l %a0, %a1 8 | beq 2f 9 | move.b #0x00, (%a0)+ 10 | bra 1b 11 | 12 | 2: 13 | cinva %bc 14 | move.l #0x80008000, %d0 15 | movec %d0, %cacr 16 | 17 | move.l #0x0000A040, %d0 18 | movec.l %d0, %dtt0 19 | 20 | move.l #0x0000A000, %d0 21 | movec.l %d0, %itt0 22 | 23 | jsr main 24 | 25 | cmp #0, %d0 26 | bne fail 27 | 28 | fail: 29 | move.l #0x04040404, %d4 30 | bra fill 31 | 32 | success: 33 | move.l #0x02020202, %d4 34 | bra fill 35 | 36 | fill: 37 | move.l #524288, %d5 38 | 1: 39 | move.l %d4, (%d5) 40 | addq.l #4, %d5 41 | 42 | cmpi.l #908288, %d5 43 | bne 1b 44 | 2: 45 | bra 2b 46 | 47 | .align 2 48 | .global reboot 49 | reboot: 50 | move.l #0x00000000, %d0 51 | movec %d0, %cacr 52 | lea 0x100000, %sp 53 | jmp 0x8 54 | 55 | -------------------------------------------------------------------------------- /hw/motherboard/lib/ada4851-4.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # ADA4851-4 5 | # 6 | DEF ADA4851-4 U 0 40 Y Y 4 F N 7 | F0 "U" 350 -300 60 H V C CNN 8 | F1 "ADA4851-4" 350 300 60 H V C CNN 9 | F2 "" 0 0 60 H V C CNN 10 | F3 "" 0 0 60 H V C CNN 11 | DRAW 12 | P 5 0 1 0 -350 400 600 0 -350 -400 -350 400 -350 300 N 13 | X VS+ 4 0 550 300 D 50 50 0 1 I 14 | X VS- 11 0 -550 300 U 50 50 0 1 W 15 | X OUT 1 900 0 300 L 50 50 1 1 O 16 | X IN- 2 -650 150 300 R 50 50 1 1 I 17 | X IN+ 3 -650 -150 300 R 50 50 1 1 I 18 | X IN+ 5 -650 -150 300 R 50 50 2 1 I 19 | X IN- 6 -650 150 300 R 50 50 2 1 I 20 | X OUT 7 900 0 300 L 50 50 2 1 O 21 | X OUT 8 900 0 300 L 50 50 3 1 O 22 | X IN- 9 -650 150 300 R 50 50 3 1 I 23 | X IN+ 10 -650 -150 300 R 50 50 3 1 I 24 | X IN+ 12 -650 -150 300 R 50 50 4 1 I 25 | X IN- 13 -650 150 300 R 50 50 4 1 I 26 | X OUT 14 900 0 300 L 50 50 4 1 O 27 | ENDDRAW 28 | ENDDEF 29 | # 30 | #End Library 31 | -------------------------------------------------------------------------------- /hw/display-board/lib/ada4851-4.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # ADA4851-4 5 | # 6 | DEF ADA4851-4 U 0 40 Y Y 4 F N 7 | F0 "U" 350 -300 60 H V C CNN 8 | F1 "ADA4851-4" 350 300 60 H V C CNN 9 | F2 "" 0 0 60 H V C CNN 10 | F3 "" 0 0 60 H V C CNN 11 | DRAW 12 | P 5 0 1 0 -350 400 600 0 -350 -400 -350 400 -350 300 N 13 | X VS+ 4 0 550 300 D 50 50 0 1 I 14 | X VS- 11 0 -550 300 U 50 50 0 1 W 15 | X OUT 1 900 0 300 L 50 50 1 1 O 16 | X IN- 2 -650 150 300 R 50 50 1 1 I 17 | X IN+ 3 -650 -150 300 R 50 50 1 1 I 18 | X IN+ 5 -650 -150 300 R 50 50 2 1 I 19 | X IN- 6 -650 150 300 R 50 50 2 1 I 20 | X OUT 7 900 0 300 L 50 50 2 1 O 21 | X OUT 8 900 0 300 L 50 50 3 1 O 22 | X IN- 9 -650 150 300 R 50 50 3 1 I 23 | X IN+ 10 -650 -150 300 R 50 50 3 1 I 24 | X IN+ 12 -650 -150 300 R 50 50 4 1 I 25 | X IN- 13 -650 150 300 R 50 50 4 1 I 26 | X OUT 14 900 0 300 L 50 50 4 1 O 27 | ENDDRAW 28 | ENDDEF 29 | # 30 | #End Library 31 | -------------------------------------------------------------------------------- /src/common/peripheral/include/peripheral.h: -------------------------------------------------------------------------------- 1 | #ifndef _PERIPHERAL_H 2 | #define _PERIPHERAL_H 3 | 4 | #define ROM_BASE 0x00000000UL 5 | #define LLRAM_BASE 0x00080000UL 6 | #define CHIPSET_BASE 0x00100000UL 7 | #define SDRAM_BASE 0x80000000UL 8 | 9 | #define PERIPHERAL_INTERRUPT_BASE (CHIPSET_BASE + 0x000) 10 | #define PERIPHERAL_TIMER_BASE (CHIPSET_BASE + 0x200) 11 | #define PERIPHERAL_SPI_BASE (CHIPSET_BASE + 0x800) 12 | #define PERIPHERAL_UART_BASE (CHIPSET_BASE + 0x900) 13 | #define PERIPHERAL_VGA_BASE (CHIPSET_BASE + 0xA00) 14 | #define PERIPHERAL_SOUND_BASE (CHIPSET_BASE + 0xB00) 15 | 16 | typedef enum PeripheralID PeripheralID; 17 | enum PeripheralID { 18 | PERIPHERAL_ID_TIMER = 2, 19 | PERIPHERAL_ID_SPI = 8, 20 | PERIPHERAL_ID_UART, 21 | PERIPHERAL_ID_VGA, 22 | PERIPHERAL_ID_AUDIO, 23 | PERIPHERAL_ID_EXTINT1 = 15, 24 | PERIPHERAL_ID_EXTINT2, 25 | PERIPHERAL_ID_EXTINT3, 26 | PERIPHERAL_ID_EXTINT4, 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/kbd/interrupt.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "interrupt.h" 5 | #include "protocol.h" 6 | 7 | void interrupt_init(bool interrupt) { 8 | //DDRA &= ~(1 << 3); 9 | DDRA |= (1 << 3); 10 | PORTA |= (1 << 3); 11 | 12 | *((uint8_t *) ®_status) = 0x0; 13 | *((uint8_t *) ®_control) = 0x0; 14 | reg_control.keyboard_ie = true; 15 | 16 | if(interrupt) 17 | PORTA &= ~(1 << 3); 18 | } 19 | 20 | void interrupt_deinit() { 21 | DDRA &= ~(1 << 3); 22 | interrupt_deassert(); 23 | } 24 | 25 | void interrupt_assert() { 26 | register uint8_t flag, mask; 27 | 28 | flag = *((uint8_t *) ®_status); 29 | mask = *((uint8_t *) ®_control); 30 | 31 | if(flag & mask) { 32 | //PORTA &= ~(1 << 3); 33 | //DDRA |= (1 << 3); 34 | //PORTA &= ~(1 << 3); 35 | PORTA &= ~(1 << 3); 36 | } 37 | } 38 | 39 | void interrupt_deassert() { 40 | //DDRA &= ~(1 << 3); 41 | PORTA |= (1 << 3); 42 | } 43 | -------------------------------------------------------------------------------- /hw/motherboard/lib/epc2.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # EPC2 5 | # 6 | DEF EPC2 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -50 60 H V C CNN 8 | F1 "EPC2" 0 50 60 H V C CNN 9 | F2 "" -100 0 60 H V C CNN 10 | F3 "" -100 0 60 H V C CNN 11 | DRAW 12 | S -550 800 550 -550 0 1 0 N 13 | X DCLK 2 750 300 200 L 50 50 1 1 B C 14 | X VCCSEL 3 -750 400 200 R 50 50 1 1 I 15 | X OE 7 750 -200 200 L 50 50 1 1 C 16 | X ~CS 10 -750 200 200 R 50 50 1 1 I 17 | X DATA 31 750 400 200 L 50 50 1 1 O 18 | X GND 12 0 -800 200 U 50 50 1 1 W 19 | X TCK 32 -750 -300 200 R 50 50 1 1 I C 20 | X TDI 13 -750 0 200 R 50 50 1 1 I 21 | X VPP 23 50 1000 200 D 50 50 1 1 W 22 | X ~CASC 15 750 0 200 L 50 50 1 1 O 23 | X TMS 25 -750 -100 200 R 50 50 1 1 I 24 | X ~INITCONF 16 750 100 200 L 50 50 1 1 C 25 | X VPPSEL 17 -750 500 200 R 50 50 1 1 I 26 | X VCC 27 -50 1000 200 D 50 50 1 1 W 27 | X TDO 28 -750 -200 200 R 50 50 1 1 O 28 | ENDDRAW 29 | ENDDEF 30 | # 31 | #End Library 32 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/spacer.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_SPACER_H 11 | #define MUIL_SPACER_H 12 | 13 | struct MuilSpacerProperties { 14 | int set_w; 15 | int set_h; 16 | }; 17 | 18 | MuilWidget *muil_widget_create_spacer(); 19 | MuilWidget *muil_widget_create_spacer_size(int w, int h); 20 | 21 | MuilPropertyValue muil_spacer_get_prop(MuilWidget *widget, int prop); 22 | void muil_spacer_set_prop(MuilWidget *widget, int prop, MuilPropertyValue value); 23 | void muil_spacer_request_size(MuilWidget *widget, int *w, int *h); 24 | void muil_spacer_resize(MuilWidget *widget, int x, int y, int w, int h); 25 | void muil_spacer_render(MuilWidget *widget); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /hw/display-board/lib/epc2.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # EPC2 5 | # 6 | DEF EPC2 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -50 60 H V C CNN 8 | F1 "EPC2" 0 50 60 H V C CNN 9 | F2 "" -100 0 60 H V C CNN 10 | F3 "" -100 0 60 H V C CNN 11 | DRAW 12 | S -550 800 550 -550 0 1 0 N 13 | X DCLK 2 750 300 200 L 50 50 1 1 B C 14 | X VCCSEL 3 -750 400 200 R 50 50 1 1 I 15 | X OE 7 750 -200 200 L 50 50 1 1 C 16 | X ~CS 10 -750 200 200 R 50 50 1 1 I 17 | X DATA 31 750 400 200 L 50 50 1 1 O 18 | X GND 12 0 -800 200 U 50 50 1 1 W 19 | X TCK 32 -750 -300 200 R 50 50 1 1 I C 20 | X TDI 13 -750 0 200 R 50 50 1 1 I 21 | X VPP 23 50 1000 200 D 50 50 1 1 W 22 | X ~CASC 15 750 0 200 L 50 50 1 1 O 23 | X TMS 25 -750 -100 200 R 50 50 1 1 I 24 | X ~INITCONF 16 750 100 200 L 50 50 1 1 C 25 | X VPPSEL 17 -750 500 200 R 50 50 1 1 I 26 | X VCC 27 -50 1000 200 D 50 50 1 1 W 27 | X TDO 28 -750 -200 200 R 50 50 1 1 O 28 | ENDDRAW 29 | ENDDEF 30 | # 31 | #End Library 32 | -------------------------------------------------------------------------------- /src/kbd/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "sleep.h" 7 | #include "power.h" 8 | #include "protocol.h" 9 | #include "spi.h" 10 | #include "keyboard.h" 11 | #include "mouse.h" 12 | #include "interrupt.h" 13 | 14 | StatusRegister reg_status; 15 | ControlRegister reg_control = { 16 | .keyboard_ie = true, 17 | }; 18 | 19 | ISR(TIMER0_COMPA_vect) { 20 | keyboard_tick(); 21 | mouse_tick(); 22 | interrupt_assert(); 23 | } 24 | 25 | void timer_init() { 26 | TCCR0A = 0xD; //Clear on compare, clk/1024 27 | TCNT0 = 0; 28 | OCR0A = 24; 29 | TIMSK0 = 0x2; //Interrupt on compare A 30 | 31 | } 32 | 33 | void timer_deinit() { 34 | TCCR0A = 0x0; 35 | TIMSK0 = 0x0; 36 | TCNT0 = 0; 37 | } 38 | 39 | int main() { 40 | power_init(); 41 | for(;;) { 42 | cli(); 43 | sleep_enable(); 44 | sei(); 45 | sleep_cpu(); 46 | sleep_disable(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/common/peripheral/src/interrupt.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "peripheral.h" 3 | #include "interrupt.h" 4 | 5 | static void **int_vector = (void *) 0xDE800; 6 | 7 | static void (*handler[7])(int); 8 | 9 | void interrupt_init() { 10 | int i; 11 | 12 | interrupt_move_vector((void *) 0xDE800); 13 | 14 | for(i = 0; i < 255; i++) 15 | int_vector[i] = interrupt_isr_unhandled; 16 | 17 | for(i = 25; i < 24 + 8; i ++) 18 | int_vector[i] = interrupt_isr_trampoline; 19 | } 20 | 21 | void interrupt_perihperal_enable(uint32_t n, uint8_t priority) { 22 | volatile uint32_t *interrupt_hw = (volatile uint32_t *) PERIPHERAL_INTERRUPT_BASE; 23 | interrupt_hw[32 + n] = 0x0; 24 | interrupt_hw[n] = priority & 0x7; 25 | } 26 | 27 | void interrupt_register(int priority, void (h)(int)) { 28 | handler[priority] = h; 29 | } 30 | 31 | void interrupt_isr_stage2(int number) { 32 | number -= 24; 33 | 34 | if(handler[number]) 35 | handler[number](number); 36 | } 37 | -------------------------------------------------------------------------------- /src/common/util/include/mem.h: -------------------------------------------------------------------------------- 1 | #ifndef MEM_H_ 2 | #define MEM_H_ 3 | 4 | #include 5 | #include 6 | 7 | #define PAGE_SIZE 4096UL 8 | #define PAGE_MASK (PAGE_SIZE - 1) 9 | 10 | void *memset(void *pointer, int c, size_t n); 11 | void *memcpy(void *dest, void *src, size_t n); 12 | 13 | char *strcat(char *dest, const char *src); 14 | size_t strlen(const char *c); 15 | size_t strnlen(const char *c, size_t maxlen); 16 | int isalpha(int c); 17 | int isdigit(int c); 18 | char *strncpy(char *dest, const char *src, size_t max); 19 | char *strcpy(char *dest, const char *src); 20 | int strcmp(const char *s1, const char *s2); 21 | int strncmp(const char *s1, const char *s2, size_t n); 22 | char *strchr(char *str, char chr); 23 | int memcmp(const void *s1, const void *s2, size_t n); 24 | 25 | 26 | void *calloc(size_t nmemb, size_t size); 27 | void *sbrk(intptr_t increment); 28 | void *malloc(size_t size); 29 | void *realloc(void *ptr, size_t size); 30 | void free(void *ptr); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/common/peripheral/include/rom.h: -------------------------------------------------------------------------------- 1 | #ifndef _ROM_H_ 2 | #define _ROM_H_ 3 | 4 | #include 5 | 6 | #define ROM_SIZE 0x80000 7 | 8 | typedef enum RomCommand RomCommand; 9 | enum RomCommand { 10 | ROM_COMMAND_WRITE_ENABLE = 0x6, 11 | ROM_COMMAND_WRITE_DISABLE = 0x4, 12 | ROM_COMMAND_READ_STATUS = 0x5, 13 | ROM_COMMAND_WRITE_STATUS = 0x1, 14 | ROM_COMMAND_READ_DATA = 0x3, 15 | ROM_COMMAND_READ_DATA_FAST = 0xB, 16 | ROM_COMMAND_READ_DATA_FAST_DUAL = 0x3B, 17 | ROM_COMMAND_PAGE_PROGRAM = 0x2, 18 | ROM_COMMAND_ERASE_BLOCK = 0xD8, 19 | ROM_COMMAND_ERASE_SECTOR = 0x20, 20 | ROM_COMMAND_ERASE_CHIP = 0xC7, 21 | ROM_COMMAND_POWER_DOWN = 0xB9, 22 | ROM_COMMAND_DEVICE_ID = 0xAB, 23 | ROM_COMMAND_MANUFACTURER = 0x90, 24 | ROM_COMMAND_JEDEC_ID = 0x9F, 25 | }; 26 | 27 | uint8_t rom_status(); 28 | void rom_write_enable(); 29 | void rom_erase(); 30 | void rom_write(uint32_t address, const uint8_t *buffer, uint32_t size); 31 | void rom_read(uint32_t address, uint8_t *buffer, uint32_t size); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/demos/tsko/include/main.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_H_ 2 | #define MAIN_H_ 3 | 4 | #include 5 | 6 | extern uint8_t fat_buf[512]; 7 | 8 | typedef struct DemoData DemoData; 9 | struct DemoData { 10 | uint8_t a1[64000]; 11 | uint8_t a2[64000]; 12 | uint8_t am[64000]; 13 | uint8_t and[64000]; 14 | uint8_t b1[64000]; 15 | uint8_t b2[64000]; 16 | uint8_t bej[64000]; 17 | uint8_t c1[64000]; 18 | uint8_t c2[64000]; 19 | uint8_t c3[64000]; 20 | uint8_t c4[64000]; 21 | uint8_t c5[64000]; 22 | uint8_t find[64000]; 23 | uint8_t h3y[64000]; 24 | uint8_t him[64000]; 25 | uint8_t jader[64000]; 26 | uint8_t know[64000]; 27 | uint8_t kraft[64000]; 28 | uint8_t me[64000]; 29 | uint8_t mist[64000]; 30 | uint8_t mlarge[64000]; 31 | uint8_t msmall[64000]; 32 | uint8_t terror[64000]; 33 | uint8_t tj0[64000]; 34 | uint8_t tsko[64000]; 35 | uint8_t want[64000]; 36 | uint8_t you[64000]; 37 | 38 | 39 | void *modfile; 40 | uint32_t modsize; 41 | }; 42 | 43 | extern DemoData data; 44 | 45 | void demo(); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /hdl/bootrom.cmp: -------------------------------------------------------------------------------- 1 | --Copyright (C) 1991-2009 Altera Corporation 2 | --Your use of Altera Corporation's design tools, logic functions 3 | --and other software and tools, and its AMPP partner logic 4 | --functions, and any output files from any of the foregoing 5 | --(including device programming or simulation files), and any 6 | --associated documentation or information are expressly subject 7 | --to the terms and conditions of the Altera Program License 8 | --Subscription Agreement, Altera MegaCore Function License 9 | --Agreement, or other applicable license agreement, including, 10 | --without limitation, that your use is for the sole purpose of 11 | --programming logic devices manufactured by Altera and sold by 12 | --Altera or its authorized distributors. Please refer to the 13 | --applicable agreement for further details. 14 | 15 | 16 | component bootrom 17 | PORT 18 | ( 19 | address : IN STD_LOGIC_VECTOR (6 DOWNTO 0); 20 | q : OUT STD_LOGIC_VECTOR (31 DOWNTO 0) 21 | ); 22 | end component; 23 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/audio.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # FCR1295 5 | # 6 | DEF FCR1295 J 0 30 Y Y 1 F N 7 | F0 "J" 0 400 50 H V C CNN 8 | F1 "FCR1295" -50 -300 50 H V C CNN 9 | F2 "" 100 -150 50 H I C CNN 10 | F3 "" 100 -150 50 H I C CNN 11 | DRAW 12 | P 3 0 0 0 150 -200 150 -100 300 -100 N 13 | P 3 0 0 0 150 0 150 100 300 100 N 14 | P 3 0 0 0 150 200 150 300 300 300 N 15 | P 4 0 0 0 -350 200 -300 150 -250 200 300 200 N 16 | P 4 0 0 0 -250 0 -200 50 50 -200 300 -200 N 17 | S -450 200 -400 -50 0 1 0 F 18 | S 300 -250 -400 350 0 1 10 f 19 | P 2 0 1 0 50 0 300 0 N 20 | P 4 0 1 0 50 0 0 50 -50 0 -50 0 N 21 | P 4 0 1 0 100 -150 150 -200 200 -150 200 -150 N 22 | P 4 0 1 0 100 50 150 0 200 50 200 50 N 23 | P 4 0 1 0 100 250 150 200 200 250 200 250 N 24 | X SN 1 400 300 100 L 50 50 1 1 P 25 | X RN 2 400 -100 100 L 50 50 1 1 P 26 | X TN 3 400 100 100 L 50 50 1 1 P 27 | X S 4 400 200 100 L 50 50 1 1 P 28 | X R 5 400 -200 100 L 50 50 1 1 P 29 | X T 6 400 0 100 L 50 50 1 1 P 30 | ENDDRAW 31 | ENDDEF 32 | # 33 | #End Library 34 | -------------------------------------------------------------------------------- /hw/motherboard/lib/tlc7524.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # TLC7524 5 | # 6 | DEF TLC7524 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -50 60 H V C CNN 8 | F1 "TLC7524" 0 50 60 H V C CNN 9 | F2 "" 0 0 60 H V C CNN 10 | F3 "" 0 0 60 H V C CNN 11 | DRAW 12 | T 0 -250 -200 60 0 0 0 LSB Normal 0 C C 13 | T 0 -250 500 60 0 0 0 MSB Normal 0 C C 14 | S -550 600 550 -600 0 0 0 N 15 | X OUT1 1 850 200 300 L 50 50 1 1 O 16 | X OUT2 2 850 100 300 L 50 50 1 1 O 17 | X GND 3 0 -900 300 U 50 50 1 1 W 18 | X D7 4 -850 500 300 R 50 50 1 1 I 19 | X D6 5 -850 400 300 R 50 50 1 1 I 20 | X D5 6 -850 300 300 R 50 50 1 1 I 21 | X D4 7 -850 200 300 R 50 50 1 1 I 22 | X D3 8 -850 100 300 R 50 50 1 1 I 23 | X D2 9 -850 0 300 R 50 50 1 1 I 24 | X D1 10 -850 -100 300 R 50 50 1 1 I 25 | X D0 11 -850 -200 300 R 50 50 1 1 I 26 | X ~CS 12 -850 -500 300 R 50 50 1 1 I 27 | X ~WR 13 -850 -400 300 R 50 50 1 1 I 28 | X VCC 14 0 900 300 D 50 50 1 1 W 29 | X REF 15 850 -200 300 L 50 50 1 1 I 30 | X RFB 16 850 -100 300 L 50 50 1 1 I 31 | ENDDRAW 32 | ENDDEF 33 | # 34 | #End Library 35 | -------------------------------------------------------------------------------- /src/stage2/config.mk: -------------------------------------------------------------------------------- 1 | # UART settings for programmer 2 | TTYDEV ?=/dev/ttyUSB0 3 | TTYBAUD ?=115200 4 | 5 | # Name of the output file 6 | NAME = stage2 7 | 8 | # Linkscript 9 | LINKSCRIPT = link.ld 10 | 11 | # Tools 12 | TARGET = m68k-elf- 13 | CC = $(TARGET)gcc 14 | AS = $(TARGET)as 15 | LD = $(TARGET)ld 16 | AR = $(TARGET)ar 17 | SREC_CAT = srec_cat 18 | 19 | # Paths 20 | MODULESDIR = $(TOPDIR)/libs 21 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 22 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 23 | 24 | INCLUDEDIRS = $(TOPDIR)/include $(MODULESINCLUDE) 25 | 26 | # Compiler and linker flags 27 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 28 | 29 | CFLAGS = -Wall -Os -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 30 | ASFLAGS = -msoft-float 31 | LDFLAGS = -T $(LINKSCRIPT) -lgcc 32 | 33 | # Filenames 34 | ELFFILE = $(NAME).elf 35 | HEXFILE = $(NAME).hex 36 | BINFILE = $(NAME).bin 37 | 38 | # Makefile configurations 39 | MAKEFLAGS += --no-print-directory 40 | -------------------------------------------------------------------------------- /hw/display-board/lib/tlc7524.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # TLC7524 5 | # 6 | DEF TLC7524 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -50 60 H V C CNN 8 | F1 "TLC7524" 0 50 60 H V C CNN 9 | F2 "" 0 0 60 H V C CNN 10 | F3 "" 0 0 60 H V C CNN 11 | DRAW 12 | T 0 -250 -200 60 0 0 0 LSB Normal 0 C C 13 | T 0 -250 500 60 0 0 0 MSB Normal 0 C C 14 | S -550 600 550 -600 0 0 0 N 15 | X OUT1 1 850 200 300 L 50 50 1 1 O 16 | X OUT2 2 850 100 300 L 50 50 1 1 O 17 | X GND 3 0 -900 300 U 50 50 1 1 W 18 | X D7 4 -850 500 300 R 50 50 1 1 I 19 | X D6 5 -850 400 300 R 50 50 1 1 I 20 | X D5 6 -850 300 300 R 50 50 1 1 I 21 | X D4 7 -850 200 300 R 50 50 1 1 I 22 | X D3 8 -850 100 300 R 50 50 1 1 I 23 | X D2 9 -850 0 300 R 50 50 1 1 I 24 | X D1 10 -850 -100 300 R 50 50 1 1 I 25 | X D0 11 -850 -200 300 R 50 50 1 1 I 26 | X ~CS 12 -850 -500 300 R 50 50 1 1 I 27 | X ~WR 13 -850 -400 300 R 50 50 1 1 I 28 | X VCC 14 0 900 300 D 50 50 1 1 W 29 | X REF 15 850 -200 300 L 50 50 1 1 I 30 | X RFB 16 850 -100 300 L 50 50 1 1 I 31 | ENDDRAW 32 | ENDDEF 33 | # 34 | #End Library 35 | -------------------------------------------------------------------------------- /src/demos/bounce/bounce.c: -------------------------------------------------------------------------------- 1 | #include 2 | #define MEM_VGA_RAM ((volatile uint8_t *) 0x80000) 3 | 4 | #define DISPLAY_W 800 5 | #define DISPLAY_H 480 6 | 7 | void dumbdelay(volatile unsigned int count) { 8 | while(count-- != 0); 9 | } 10 | 11 | int main() { 12 | int i, j; 13 | int x = 10, y = 10; 14 | int xvel = 1, yvel = 1; 15 | int size = 20; 16 | unsigned char col = 0; 17 | 18 | for(i = 0; i < DISPLAY_W*DISPLAY_H; i++) 19 | MEM_VGA_RAM[i] = 0x0; 20 | 21 | for(;;) { 22 | for(i = y; i < y + size; i++) 23 | for(j = x; j < x + size; j++) 24 | MEM_VGA_RAM[i * DISPLAY_W + j] = 0x0; 25 | 26 | x += xvel; 27 | if(x + size > (DISPLAY_W - 1) || x < 0) { 28 | xvel = -xvel; 29 | x += xvel; 30 | } 31 | 32 | y += yvel; 33 | if(y + size > (DISPLAY_H - 1) || y < 0) { 34 | yvel = -yvel; 35 | y += yvel; 36 | } 37 | 38 | for(i = y; i < y + size; i++) 39 | for(j = x; j < x + size; j++) 40 | MEM_VGA_RAM[i * DISPLAY_W + j] = col; 41 | 42 | col++; 43 | dumbdelay(10000); 44 | } 45 | 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /src/common/peripheral/src/uart.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "util.h" 3 | #include "uart.h" 4 | 5 | void uart_send(uint8_t dat) { 6 | nop(); 7 | while(!(UART_REG_STATUS & 0x1)); 8 | nop(); 9 | UART_REG_DATA = dat; 10 | nop(); 11 | } 12 | 13 | uint8_t uart_flush() { 14 | nop(); 15 | return UART_REG_DATA; 16 | } 17 | 18 | uint8_t uart_recv() { 19 | nop(); 20 | while(!(UART_REG_STATUS & 0x2)); 21 | nop(); 22 | return UART_REG_DATA; 23 | } 24 | 25 | void uart_send_hex(uint8_t h) { 26 | char c; 27 | uart_send('0'); 28 | uart_send('x'); 29 | c = (h >> 4) + '0'; 30 | if(c > '9') 31 | c += 'A' - '0'; 32 | uart_send(c); 33 | 34 | c = (h & 0xF) + '0'; 35 | if(c > '9') 36 | c += 'A' - '0'; 37 | uart_send(c); 38 | } 39 | 40 | void uart_send_string(char *s) { 41 | char c; 42 | while((c = *s++)) 43 | uart_send((uint8_t) c); 44 | } 45 | 46 | void uart_putc_convnl(char c) { 47 | if(c == '\n') 48 | uart_send('\r'); 49 | uart_send((uint8_t) c); 50 | } 51 | 52 | void uart_puts_convnl(const char *s) { 53 | while(*s) 54 | uart_putc_convnl(*s++); 55 | } 56 | -------------------------------------------------------------------------------- /src/common/peripheral/src/interrupt.S: -------------------------------------------------------------------------------- 1 | .align 2 2 | .global interrupt_isr_trampoline 3 | interrupt_isr_trampoline: 4 | move.l %a0, -(%sp) 5 | move.l %a1, -(%sp) 6 | move.l %d0, -(%sp) 7 | move.l %d1, -(%sp) 8 | 9 | link %fp, #0 10 | 11 | move.w 26(%fp), %d0 12 | andi.l #0x0FFF, %d0 13 | lsr.l #2, %d0 14 | move.l %d0, -(%sp) 15 | jsr.l interrupt_isr_stage2 16 | adda.l #4, %sp 17 | 18 | unlk %fp 19 | 20 | move.l (%sp)+, %d1 21 | move.l (%sp)+, %d0 22 | move.l (%sp)+, %a1 23 | move.l (%sp)+, %a0 24 | rte 25 | 26 | .align 2 27 | .global interrupt_isr_unhandled 28 | interrupt_isr_unhandled: 29 | rte 30 | 31 | .align 2 32 | .global interrupt_move_vector 33 | interrupt_move_vector: 34 | link %fp, #0 35 | move.l 8(%fp), %a0 36 | move.l %a0, %d1 37 | 38 | movec %d1, %vbr 39 | unlk %fp 40 | rts 41 | 42 | .align 2 43 | .global interrupt_global_enable 44 | interrupt_global_enable: 45 | and.w #0xF8FF, %sr 46 | #mov.w #0x2000, %sr 47 | rts 48 | 49 | .align 2 50 | .global interrupt_global_disable 51 | interrupt_global_disable: 52 | or.w #0x0700, %sr 53 | rts 54 | -------------------------------------------------------------------------------- /src/stage2/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) $(MODULESDIR) 6 | 7 | MODULESLIBS = $(addsuffix .a,$(MODULES)) 8 | 9 | 10 | .PHONY: all clean install 11 | .PHONY: $(SUBDIRS) 12 | .SUFFIXES: 13 | 14 | all: $(HEXFILE) $(BINFILE) 15 | @echo "Build complete." 16 | @echo 17 | 18 | install: 19 | stty -F $(TTYDEV) $(TTYBAUD) 20 | cat $(NAME).hex > $(TTYDEV) 21 | 22 | clean: $(SUBDIRS) 23 | @echo " [ RM ] $(BINFILE)" 24 | @$(RM) $(BINFILE) 25 | 26 | @echo 27 | @echo "Source tree cleaned." 28 | @echo 29 | 30 | $(ELFFILE): $(SUBDIRS) 31 | @echo " [ LD ] $@" 32 | @$(CC) -o $@ $(CFLAGS) -Wl,--whole-archive $(addsuffix /out.a,$(SRCDIR)) $(MODULESLIBS) -Wl,--no-whole-archive $(LDFLAGS) 33 | 34 | $(HEXFILE): $(ELFFILE) 35 | @echo " [OCPY] $@" 36 | @$(TARGET)objcopy -O ihex $< $@ 37 | @$(SREC_CAT) -O $@ -Intel $@ -Intel 38 | 39 | $(BINFILE): $(ELFFILE) 40 | @echo " [OCPY] $@" 41 | @$(TARGET)objcopy -O binary $< $@ 42 | 43 | $(SUBDIRS): 44 | @echo " [ CD ] $(CURRENTPATH)$@/" 45 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 46 | -------------------------------------------------------------------------------- /src/demos/trololo/config.mk: -------------------------------------------------------------------------------- 1 | # UART settings for programmer 2 | TTYDEV ?=/dev/ttyUSB0 3 | TTYBAUD ?=115200 4 | 5 | # Name of the output file 6 | NAME = trololo 7 | 8 | # Linkscript 9 | LINKSCRIPT = link.ld 10 | 11 | # Tools 12 | TARGET = m68k-elf- 13 | CC = $(TARGET)gcc 14 | AS = $(TARGET)as 15 | LD = $(TARGET)ld 16 | AR = $(TARGET)ar 17 | SREC_CAT = srec_cat 18 | 19 | # Paths 20 | MODULESDIR = $(TOPDIR)/libs 21 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 22 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 23 | 24 | INCLUDEDIRS = $(TOPDIR)/include $(MODULESINCLUDE) 25 | 26 | # Compiler and linker flags 27 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 28 | 29 | CFLAGS = -Wall -Os -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 30 | ASFLAGS = -msoft-float 31 | LDFLAGS = -T $(LINKSCRIPT) -lgcc 32 | 33 | # Filenames 34 | ELFFILE = $(NAME).elf 35 | ELFDEBUGFILE = $(NAME)-debug.elf 36 | HEXFILE = $(NAME).hex 37 | BINFILE = $(NAME).bin 38 | 39 | # Makefile configurations 40 | MAKEFLAGS += --no-print-directory 41 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/pane.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_PANE_H 11 | #define MUIL_PANE_H 12 | 13 | #include 14 | 15 | typedef struct { 16 | int x; 17 | int y; 18 | int w; 19 | int h; 20 | DrawLineSet *border; 21 | DrawRectSet *background; 22 | MuilWidget *root_widget; 23 | bool needs_redraw; 24 | } MuilPane; 25 | 26 | struct MuilPaneList { 27 | MuilPane *pane; 28 | struct MuilPaneList *next; 29 | }; 30 | 31 | MuilPane *muil_pane_create(int x, int y, int w, int h, MuilWidget *root_widget); 32 | void *muil_pane_destroy(MuilPane *pane); 33 | 34 | void muil_pane_resize(MuilPane *pane, int x, int y, int w, int h); 35 | void muil_pane_set_root_widget(MuilPane *pane, MuilWidget *root_widget); 36 | void muil_pane_render(MuilPane *pane); 37 | void muil_panelist_render(struct MuilPaneList *panelist); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/common/peripheral/src/spi.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "spi.h" 3 | #include "delay.h" 4 | #include "util.h" 5 | 6 | void spi_select_slave(int slave) { 7 | //uint32_t count = 0; 8 | nop();nop(); 9 | while(SPI_REG_STATUS & 0x1) { 10 | nop();nop();//printf("%u\n", count++); 11 | } 12 | nop();nop(); 13 | SPI_REG_SS = slave; 14 | nop(); 15 | } 16 | 17 | uint8_t spi_send_recv(uint8_t dat) { 18 | //uint32_t count = 0; 19 | uint8_t ret; 20 | nop();nop(); 21 | while(SPI_REG_STATUS & 0x1) { 22 | nop();nop(); 23 | } 24 | nop();nop(); 25 | SPI_REG_DATA = dat; 26 | nop();nop(); //Nops force pipeline synchronization, needed when reading from IO devices 27 | while(SPI_REG_STATUS & 0x1) { 28 | nop();nop();//printf("%u\n", count++); 29 | } 30 | nop();nop(); 31 | ret = SPI_REG_DATA; 32 | nop();nop(); 33 | return ret; 34 | } 35 | 36 | void spi_set_clockdiv(uint16_t clkdiv) { 37 | nop(); 38 | SPI_REG_STATUS = ((uint32_t) clkdiv) << 16; 39 | nop(); 40 | } 41 | 42 | uint16_t spi_get_clockdiv() { 43 | uint16_t ret; 44 | nop(); 45 | ret = ((SPI_REG_STATUS) >> 16); 46 | nop(); 47 | return ret; 48 | } 49 | -------------------------------------------------------------------------------- /hdl/cursor.cmp: -------------------------------------------------------------------------------- 1 | --Copyright (C) 1991-2009 Altera Corporation 2 | --Your use of Altera Corporation's design tools, logic functions 3 | --and other software and tools, and its AMPP partner logic 4 | --functions, and any output files from any of the foregoing 5 | --(including device programming or simulation files), and any 6 | --associated documentation or information are expressly subject 7 | --to the terms and conditions of the Altera Program License 8 | --Subscription Agreement, Altera MegaCore Function License 9 | --Agreement, or other applicable license agreement, including, 10 | --without limitation, that your use is for the sole purpose of 11 | --programming logic devices manufactured by Altera and sold by 12 | --Altera or its authorized distributors. Please refer to the 13 | --applicable agreement for further details. 14 | 15 | 16 | component cursor 17 | PORT 18 | ( 19 | address : IN STD_LOGIC_VECTOR (6 DOWNTO 0); 20 | data : IN STD_LOGIC_VECTOR (1 DOWNTO 0); 21 | inclock : IN STD_LOGIC ; 22 | we : IN STD_LOGIC := '1'; 23 | q : OUT STD_LOGIC_VECTOR (1 DOWNTO 0) 24 | ); 25 | end component; 26 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/3364W.kicad_mod: -------------------------------------------------------------------------------- 1 | (module 3364W (layer F.Cu) (tedit 58A6DD53) 2 | (fp_text reference REF** (at 0.2 3.6) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value 3364W (at 0.1 -3.3) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start -1.9 -2) (end -1.3 -2) (layer F.SilkS) (width 0.15)) 9 | (fp_line (start 1.9 -2) (end 1.9 1.1) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start 0.7 2) (end -0.7 2) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start -1.9 1.1) (end -1.9 -2) (layer F.SilkS) (width 0.15)) 12 | (fp_line (start 1.3 -2) (end 1.9 -2) (layer F.SilkS) (width 0.15)) 13 | (fp_arc (start 0 0) (end 0.9 -1.1) (angle 280.1093816) (layer F.SilkS) (width 0.15)) 14 | (fp_line (start 1 0) (end -1 0) (layer F.SilkS) (width 0.15)) 15 | (fp_line (start 0 1) (end 0 -1) (layer F.SilkS) (width 0.15)) 16 | (pad 1 smd rect (at -1.5 2) (size 1.3 1.5) (layers F.Cu F.Paste F.Mask)) 17 | (pad 2 smd rect (at 0 -2) (size 2.4 1.4) (layers F.Cu F.Paste F.Mask)) 18 | (pad 3 smd rect (at 1.5 2) (size 1.3 1.5) (layers F.Cu F.Paste F.Mask)) 19 | ) 20 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/label.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_LABEL_H 11 | #define MUIL_LABEL_H 12 | 13 | #define MUIL_LABEL_PROP_FONT 0 14 | #define MUIL_LABEL_PROP_SURFACE 1 15 | #define MUIL_LABEL_PROP_TEXT 2 16 | 17 | struct MuilLabelProperties { 18 | DrawRectSet *background; 19 | DrawFont *font; 20 | DrawTextSurface *surface; 21 | char *text; 22 | }; 23 | 24 | MuilWidget *muil_widget_create_label(DrawFont *font, const char *text); 25 | void *muil_widget_destroy_label(MuilWidget *widget); 26 | 27 | void muil_label_set_prop(MuilWidget *widget, int prop, MuilPropertyValue value); 28 | MuilPropertyValue muil_label_get_prop(MuilWidget *widget, int prop); 29 | void muil_label_resize(MuilWidget *widget, int x, int y, int w, int h); 30 | void muil_label_request_size(MuilWidget *widget, int *w, int *h); 31 | void muil_label_render(MuilWidget *widget); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /hdl/palette.cmp: -------------------------------------------------------------------------------- 1 | --Copyright (C) 1991-2009 Altera Corporation 2 | --Your use of Altera Corporation's design tools, logic functions 3 | --and other software and tools, and its AMPP partner logic 4 | --functions, and any output files from any of the foregoing 5 | --(including device programming or simulation files), and any 6 | --associated documentation or information are expressly subject 7 | --to the terms and conditions of the Altera Program License 8 | --Subscription Agreement, Altera MegaCore Function License 9 | --Agreement, or other applicable license agreement, including, 10 | --without limitation, that your use is for the sole purpose of 11 | --programming logic devices manufactured by Altera and sold by 12 | --Altera or its authorized distributors. Please refer to the 13 | --applicable agreement for further details. 14 | 15 | 16 | component palette 17 | PORT 18 | ( 19 | address : IN STD_LOGIC_VECTOR (7 DOWNTO 0); 20 | data : IN STD_LOGIC_VECTOR (15 DOWNTO 0); 21 | inclock : IN STD_LOGIC ; 22 | we : IN STD_LOGIC := '1'; 23 | q : OUT STD_LOGIC_VECTOR (15 DOWNTO 0) 24 | ); 25 | end component; 26 | -------------------------------------------------------------------------------- /src/common/lz4inflate/include/lz4inflate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017 Steven Arnow 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would be 15 | appreciated but is not required. 16 | 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 20 | 3. This notice may not be removed or altered from any source 21 | distribution. 22 | */ 23 | 24 | #ifndef LZ4INFLATE_H__ 25 | #define LZ4INFLATE_H__ 26 | 27 | #include 28 | 29 | void lz4_inflate(const uint8_t *input, uint8_t *output, uint32_t input_len); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/card-edge.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # 10056847-XY1LF 5 | # 6 | DEF 10056847-XY1LF CONN 0 40 Y Y 1 F N 7 | F0 "CONN" 0 -50 60 H V C CNN 8 | F1 "10056847-XY1LF" 0 50 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | DRAW 12 | S -450 600 450 -600 0 1 0 N 13 | P 4 0 1 0 -450 -550 -400 -550 -400 550 -450 550 N 14 | X ~ 1 -650 450 200 R 50 50 1 1 P 15 | X ~ 2 -650 350 200 R 50 50 1 1 P 16 | X ~ 3 -650 250 200 R 50 50 1 1 P 17 | X ~ 4 -650 150 200 R 50 50 1 1 P 18 | X ~ 5 -650 50 200 R 50 50 1 1 P 19 | X ~ 6 -650 -50 200 R 50 50 1 1 P 20 | X ~ 7 -650 -150 200 R 50 50 1 1 P 21 | X ~ 8 -650 -250 200 R 50 50 1 1 P 22 | X ~ 9 -650 -350 200 R 50 50 1 1 P 23 | X ~ 10 -650 -450 200 R 50 50 1 1 P 24 | X ~ 20 650 500 200 L 50 50 1 1 P 25 | X ~ 11 650 -400 200 L 50 50 1 1 P 26 | X ~ 12 650 -300 200 L 50 50 1 1 P 27 | X ~ 13 650 -200 200 L 50 50 1 1 P 28 | X ~ 14 650 -100 200 L 50 50 1 1 P 29 | X ~ 15 650 0 200 L 50 50 1 1 P 30 | X ~ 16 650 100 200 L 50 50 1 1 P 31 | X ~ 17 650 200 200 L 50 50 1 1 P 32 | X ~ 18 650 300 200 L 50 50 1 1 P 33 | X ~ 19 650 400 200 L 50 50 1 1 P 34 | ENDDRAW 35 | ENDDEF 36 | # 37 | #End Library 38 | -------------------------------------------------------------------------------- /src/demos/tsko/config.mk: -------------------------------------------------------------------------------- 1 | # UART settings for programmer 2 | TTYDEV ?=/dev/ttyUSB0 3 | TTYBAUD ?=115200 4 | 5 | # Name of the output file 6 | NAME = tsko 7 | 8 | # Linkscript 9 | LINKSCRIPT = link.ld 10 | 11 | # Tools 12 | export TARGET = m68k-elf- 13 | export CC = $(TARGET)gcc 14 | export AS = $(TARGET)as 15 | export LD = $(TARGET)ld 16 | export AR = $(TARGET)ar 17 | SREC_CAT = srec_cat 18 | 19 | # Paths 20 | MODULESDIR = $(shell realpath $(TOPDIR)/libs) 21 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 22 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 23 | 24 | INCLUDEDIRS = $(shell realpath $(TOPDIR)/include) $(MODULESINCLUDE) 25 | 26 | # Compiler and linker flags 27 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 28 | 29 | export CFLAGS := -Wall -O3 -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 30 | export ASFLAGS := -msoft-float 31 | export LDFLAGS := -T $(LINKSCRIPT) -lgcc 32 | 33 | # Filenames 34 | ELFFILE = $(NAME).elf 35 | ELFDEBUGFILE = $(NAME)-debug.elf 36 | HEXFILE = $(NAME).hex 37 | BINFILE = $(NAME).bin 38 | 39 | # Makefile configurations 40 | MAKEFLAGS += --no-print-directory 41 | -------------------------------------------------------------------------------- /src/common/terminal/include/terminal.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOOT_TERM_H_ 2 | #define _BOOT_TERM_H_ 3 | 4 | #include 5 | #include "peripheral.h" 6 | 7 | #define MEM_VGA_RAM ((volatile void *) (LLRAM_BASE + 0x0)) 8 | 9 | typedef enum TerminalColor TerminalColor; 10 | enum TerminalColor { 11 | TERMINAL_COLOR_BLACK, 12 | TERMINAL_COLOR_BLUE, 13 | TERMINAL_COLOR_GREEN, 14 | TERMINAL_COLOR_CYAN, 15 | TERMINAL_COLOR_RED, 16 | TERMINAL_COLOR_MAGENTA, 17 | TERMINAL_COLOR_BROWN, 18 | TERMINAL_COLOR_LIGHT_GRAY, 19 | TERMINAL_COLOR_GRAY, 20 | TERMINAL_COLOR_LIGHT_BLUE, 21 | TERMINAL_COLOR_LIGHT_GREEN, 22 | TERMINAL_COLOR_LIGHT_CYAN, 23 | TERMINAL_COLOR_LIGHT_RED, 24 | TERMINAL_COLOR_LIGHT_MAGENTA, 25 | TERMINAL_COLOR_YELLOW, 26 | TERMINAL_COLOR_WHITE, 27 | }; 28 | 29 | void terminal_init(); 30 | void terminal_clear(); 31 | void terminal_putc(int c); 32 | void terminal_putc_term(unsigned char c); 33 | void terminal_puts(const char *str); 34 | 35 | void terminal_set_pos(int x, int y); 36 | void terminal_get_pos(int *x, int *y); 37 | void terminal_set_fg(uint8_t color); 38 | void terminal_set_bg(uint8_t color); 39 | 40 | void terminal_export(); 41 | void terminal_import(); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/demos/modplay/config.mk: -------------------------------------------------------------------------------- 1 | # UART settings for programmer 2 | TTYDEV ?=/dev/ttyUSB0 3 | TTYBAUD ?=115200 4 | 5 | # Name of the output file 6 | NAME = modplay 7 | 8 | # Linkscript 9 | LINKSCRIPT = link.ld 10 | 11 | # Tools 12 | export TARGET = m68k-elf- 13 | export CC = $(TARGET)gcc 14 | export AS = $(TARGET)as 15 | export LD = $(TARGET)ld 16 | export AR = $(TARGET)ar 17 | SREC_CAT = srec_cat 18 | 19 | # Paths 20 | MODULESDIR = $(shell realpath $(TOPDIR)/libs) 21 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 22 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 23 | 24 | INCLUDEDIRS = $(shell realpath $(TOPDIR)/include) $(MODULESINCLUDE) 25 | 26 | # Compiler and linker flags 27 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 28 | 29 | export CFLAGS := -Wall -O3 -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 30 | export ASFLAGS := -msoft-float 31 | export LDFLAGS := -T $(LINKSCRIPT) -lgcc 32 | 33 | # Filenames 34 | ELFFILE = $(NAME).elf 35 | ELFDEBUGFILE = $(NAME)-debug.elf 36 | HEXFILE = $(NAME).hex 37 | BINFILE = $(NAME).bin 38 | 39 | # Makefile configurations 40 | MAKEFLAGS += --no-print-directory 41 | -------------------------------------------------------------------------------- /src/demos/timer_test/config.mk: -------------------------------------------------------------------------------- 1 | # UART settings for programmer 2 | TTYDEV ?=/dev/ttyUSB0 3 | TTYBAUD ?=115200 4 | 5 | # Name of the output file 6 | NAME = timer_test 7 | 8 | # Linkscript 9 | LINKSCRIPT = link.ld 10 | 11 | # Tools 12 | export TARGET = m68k-elf- 13 | export CC = $(TARGET)gcc 14 | export AS = $(TARGET)as 15 | export LD = $(TARGET)ld 16 | export AR = $(TARGET)ar 17 | SREC_CAT = srec_cat 18 | 19 | # Paths 20 | MODULESDIR = $(shell realpath $(TOPDIR)/libs) 21 | MODULES = $(patsubst %/,%,$(foreach dir,$(wildcard $(MODULESDIR)/*/Makefile),$(dir $(dir)))) 22 | MODULESINCLUDE = $(addsuffix /include,$(MODULES)) 23 | 24 | INCLUDEDIRS = $(shell realpath $(TOPDIR)/include) $(MODULESINCLUDE) 25 | 26 | # Compiler and linker flags 27 | INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) 28 | 29 | export CFLAGS := -Wall -O3 -std=c99 -ffreestanding -fno-builtin -nostdlib -static -m68040 $(INCLUDES) 30 | export ASFLAGS := -msoft-float 31 | export LDFLAGS := -T $(LINKSCRIPT) -lgcc 32 | 33 | # Filenames 34 | ELFFILE = $(NAME).elf 35 | ELFDEBUGFILE = $(NAME)-debug.elf 36 | HEXFILE = $(NAME).hex 37 | BINFILE = $(NAME).bin 38 | 39 | # Makefile configurations 40 | MAKEFLAGS += --no-print-directory 41 | -------------------------------------------------------------------------------- /src/demos/tsko/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) $(MODULESDIR) 6 | 7 | MODULESLIBS = $(addsuffix .a,$(MODULES)) 8 | 9 | 10 | .PHONY: all clean install 11 | .PHONY: $(SUBDIRS) 12 | .SUFFIXES: 13 | 14 | all: $(HEXFILE) $(BINFILE) 15 | @echo "Build complete." 16 | @echo 17 | 18 | install: 19 | stty -F $(TTYDEV) $(TTYBAUD) 20 | cat $(NAME).hex > $(TTYDEV) 21 | 22 | clean: $(SUBDIRS) 23 | @echo " [ RM ] $(BINFILE)" 24 | @$(RM) $(BINFILE) 25 | 26 | @echo 27 | @echo "Source tree cleaned." 28 | @echo 29 | 30 | $(ELFFILE): $(ELFDEBUGFILE) 31 | @echo " [STRP] $@" 32 | @$(TARGET)strip -o $@ $< 33 | 34 | $(ELFDEBUGFILE): $(SUBDIRS) 35 | @echo " [ LD ] $@" 36 | @$(CC) -o $@ $(CFLAGS) -Wl,--whole-archive $(addsuffix /out.a,$(SRCDIR)) $(MODULESLIBS) -Wl,--no-whole-archive $(LDFLAGS) 37 | 38 | $(HEXFILE): $(ELFFILE) 39 | @echo " [OCPY] $@" 40 | @$(TARGET)objcopy -O ihex $< $@ 41 | @$(SREC_CAT) -O $@ -Intel $@ -Intel 42 | 43 | $(BINFILE): $(ELFFILE) 44 | @echo " [OCPY] $@" 45 | @$(TARGET)objcopy -O binary $< $@ 46 | 47 | $(SUBDIRS): 48 | @echo " [ CD ] $(CURRENTPATH)$@/" 49 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 50 | -------------------------------------------------------------------------------- /src/demos/modplay/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) $(MODULESDIR) 6 | 7 | MODULESLIBS = $(addsuffix .a,$(MODULES)) 8 | 9 | 10 | .PHONY: all clean install 11 | .PHONY: $(SUBDIRS) 12 | .SUFFIXES: 13 | 14 | all: $(HEXFILE) $(BINFILE) 15 | @echo "Build complete." 16 | @echo 17 | 18 | install: 19 | stty -F $(TTYDEV) $(TTYBAUD) 20 | cat $(NAME).hex > $(TTYDEV) 21 | 22 | clean: $(SUBDIRS) 23 | @echo " [ RM ] $(BINFILE)" 24 | @$(RM) $(BINFILE) 25 | 26 | @echo 27 | @echo "Source tree cleaned." 28 | @echo 29 | 30 | $(ELFFILE): $(ELFDEBUGFILE) 31 | @echo " [STRP] $@" 32 | @$(TARGET)strip -o $@ $< 33 | 34 | $(ELFDEBUGFILE): $(SUBDIRS) 35 | @echo " [ LD ] $@" 36 | @$(CC) -o $@ $(CFLAGS) -Wl,--whole-archive $(addsuffix /out.a,$(SRCDIR)) $(MODULESLIBS) -Wl,--no-whole-archive $(LDFLAGS) 37 | 38 | $(HEXFILE): $(ELFFILE) 39 | @echo " [OCPY] $@" 40 | @$(TARGET)objcopy -O ihex $< $@ 41 | @$(SREC_CAT) -O $@ -Intel $@ -Intel 42 | 43 | $(BINFILE): $(ELFFILE) 44 | @echo " [OCPY] $@" 45 | @$(TARGET)objcopy -O binary $< $@ 46 | 47 | $(SUBDIRS): 48 | @echo " [ CD ] $(CURRENTPATH)$@/" 49 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 50 | -------------------------------------------------------------------------------- /src/demos/timer_test/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) $(MODULESDIR) 6 | 7 | MODULESLIBS = $(addsuffix .a,$(MODULES)) 8 | 9 | 10 | .PHONY: all clean install 11 | .PHONY: $(SUBDIRS) 12 | .SUFFIXES: 13 | 14 | all: $(HEXFILE) $(BINFILE) 15 | @echo "Build complete." 16 | @echo 17 | 18 | install: 19 | stty -F $(TTYDEV) $(TTYBAUD) 20 | cat $(NAME).hex > $(TTYDEV) 21 | 22 | clean: $(SUBDIRS) 23 | @echo " [ RM ] $(BINFILE)" 24 | @$(RM) $(BINFILE) 25 | 26 | @echo 27 | @echo "Source tree cleaned." 28 | @echo 29 | 30 | $(ELFFILE): $(ELFDEBUGFILE) 31 | @echo " [STRP] $@" 32 | @$(TARGET)strip -o $@ $< 33 | 34 | $(ELFDEBUGFILE): $(SUBDIRS) 35 | @echo " [ LD ] $@" 36 | @$(CC) -o $@ $(CFLAGS) -Wl,--whole-archive $(addsuffix /out.a,$(SRCDIR)) $(MODULESLIBS) -Wl,--no-whole-archive $(LDFLAGS) 37 | 38 | $(HEXFILE): $(ELFFILE) 39 | @echo " [OCPY] $@" 40 | @$(TARGET)objcopy -O ihex $< $@ 41 | @$(SREC_CAT) -O $@ -Intel $@ -Intel 42 | 43 | $(BINFILE): $(ELFFILE) 44 | @echo " [OCPY] $@" 45 | @$(TARGET)objcopy -O binary $< $@ 46 | 47 | $(SUBDIRS): 48 | @echo " [ CD ] $(CURRENTPATH)$@/" 49 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 50 | -------------------------------------------------------------------------------- /src/demos/trololo/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include config.mk 3 | 4 | SRCDIR = src 5 | SUBDIRS = $(SRCDIR) $(MODULESDIR) 6 | 7 | MODULESLIBS = $(addsuffix .a,$(MODULES)) 8 | 9 | 10 | .PHONY: all clean install 11 | .PHONY: $(SUBDIRS) 12 | .SUFFIXES: 13 | 14 | all: $(HEXFILE) $(BINFILE) 15 | @echo "Build complete." 16 | @echo 17 | 18 | install: 19 | stty -F $(TTYDEV) $(TTYBAUD) 20 | cat $(NAME).hex > $(TTYDEV) 21 | 22 | clean: $(SUBDIRS) 23 | @echo " [ RM ] $(BINFILE)" 24 | @$(RM) $(BINFILE) 25 | 26 | @echo 27 | @echo "Source tree cleaned." 28 | @echo 29 | 30 | $(ELFFILE): $(ELFDEBUGFILE) 31 | @echo " [STRP] $@" 32 | @$(TARGET)strip -o $@ $< 33 | 34 | $(ELFDEBUGFILE): $(SUBDIRS) 35 | @echo " [ LD ] $@" 36 | @$(CC) -o $@ $(CFLAGS) -Wl,--whole-archive $(addsuffix /out.a,$(SRCDIR)) $(MODULESLIBS) -Wl,--no-whole-archive $(LDFLAGS) 37 | 38 | $(HEXFILE): $(ELFFILE) 39 | @echo " [OCPY] $@" 40 | @$(TARGET)objcopy -O ihex $< $@ 41 | @$(SREC_CAT) -O $@ -Intel $@ -Intel 42 | 43 | $(BINFILE): $(ELFFILE) 44 | @echo " [OCPY] $@" 45 | @$(TARGET)objcopy -O binary $< $@ 46 | 47 | $(SUBDIRS): 48 | @echo " [ CD ] $(CURRENTPATH)$@/" 49 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS) 50 | -------------------------------------------------------------------------------- /hw/motherboard/mod/RPACK8_SMD.kicad_mod: -------------------------------------------------------------------------------- 1 | (module RPACK8_SMD (layer F.Cu) (tedit 54B7E9AD) 2 | (fp_text reference RP4 (at 0.0635 2.667) (layer F.SilkS) 3 | (effects (font (size 0.5 0.5) (thickness 0.125))) 4 | ) 5 | (fp_text value 20k (at -0.0635 0) (layer F.SilkS) 6 | (effects (font (size 0.5 0.5) (thickness 0.125))) 7 | ) 8 | (pad 1 smd rect (at 1.24968 -1.00076) (size 0.62992 1.15062) (layers F.Cu F.Paste F.Mask)) 9 | (pad 8 smd rect (at 1.24968 1.00076) (size 0.62992 1.15062) (layers F.Cu F.Paste F.Mask)) 10 | (pad 2 smd rect (at 0.39878 -1.00076) (size 0.43942 1.15062) (layers F.Cu F.Paste F.Mask)) 11 | (pad 7 smd rect (at 0.39878 1.00076) (size 0.43942 1.15062) (layers F.Cu F.Paste F.Mask)) 12 | (pad 3 smd rect (at -0.39878 -1.00076) (size 0.43942 1.15062) (layers F.Cu F.Paste F.Mask)) 13 | (pad 6 smd rect (at -0.40132 1.00076) (size 0.43942 1.15062) (layers F.Cu F.Paste F.Mask)) 14 | (pad 4 smd rect (at -1.30048 -1.00076) (size 0.62992 1.15062) (layers F.Cu F.Paste F.Mask)) 15 | (pad 5 smd rect (at -1.30048 1.00076) (size 0.62992 1.15062) (layers F.Cu F.Paste F.Mask)) 16 | (model 3d/rpack.wrl 17 | (at (xyz 0 0 0)) 18 | (scale (xyz 1 1 1)) 19 | (rotate (xyz 0 0 0)) 20 | ) 21 | ) 22 | -------------------------------------------------------------------------------- /hw/display-board/mod/RPACK8_SMD.kicad_mod: -------------------------------------------------------------------------------- 1 | (module RPACK8_SMD (layer F.Cu) (tedit 54B7E9AD) 2 | (fp_text reference RP4 (at 0.0635 2.667) (layer F.SilkS) 3 | (effects (font (size 0.5 0.5) (thickness 0.125))) 4 | ) 5 | (fp_text value 20k (at -0.0635 0) (layer F.SilkS) 6 | (effects (font (size 0.5 0.5) (thickness 0.125))) 7 | ) 8 | (pad 1 smd rect (at 1.24968 -1.00076) (size 0.62992 1.15062) (layers F.Cu F.Paste F.Mask)) 9 | (pad 8 smd rect (at 1.24968 1.00076) (size 0.62992 1.15062) (layers F.Cu F.Paste F.Mask)) 10 | (pad 2 smd rect (at 0.39878 -1.00076) (size 0.43942 1.15062) (layers F.Cu F.Paste F.Mask)) 11 | (pad 7 smd rect (at 0.39878 1.00076) (size 0.43942 1.15062) (layers F.Cu F.Paste F.Mask)) 12 | (pad 3 smd rect (at -0.39878 -1.00076) (size 0.43942 1.15062) (layers F.Cu F.Paste F.Mask)) 13 | (pad 6 smd rect (at -0.40132 1.00076) (size 0.43942 1.15062) (layers F.Cu F.Paste F.Mask)) 14 | (pad 4 smd rect (at -1.30048 -1.00076) (size 0.62992 1.15062) (layers F.Cu F.Paste F.Mask)) 15 | (pad 5 smd rect (at -1.30048 1.00076) (size 0.62992 1.15062) (layers F.Cu F.Paste F.Mask)) 16 | (model 3d/rpack.wrl 17 | (at (xyz 0 0 0)) 18 | (scale (xyz 1 1 1)) 19 | (rotate (xyz 0 0 0)) 20 | ) 21 | ) 22 | -------------------------------------------------------------------------------- /src/kbd/protocol.h: -------------------------------------------------------------------------------- 1 | #ifndef PROTOCOL_H_ 2 | #define PROTOCOL_H_ 3 | 4 | typedef enum ProtocolCommand ProtocolCommand; 5 | enum ProtocolCommand { 6 | PROTOCOL_COMMAND_SEND_BUFFER = -2, 7 | PROTOCOL_COMMAND_NONE = -1, 8 | PROTOCOL_COMMAND_STATUS, 9 | PROTOCOL_COMMAND_CONTROL, 10 | PROTOCOL_COMMAND_KEYBOARD_EVENT, 11 | PROTOCOL_COMMAND_MOUSE_EVENT, 12 | PROTOCOL_COMMAND_POWER_OFF, 13 | PROTOCOL_COMMAND_POWER_REBOOT, 14 | PROTOCOL_COMMAND_VOLUME, 15 | PROTOCOL_COMMAND_ADC, 16 | PROTOCOL_COMMAND_I2C, 17 | PROTOCOL_COMMAND_DIGITIZER_EVENT, 18 | }; 19 | 20 | typedef struct StatusRegister StatusRegister; 21 | struct StatusRegister { 22 | uint8_t keyboard_if : 1; 23 | uint8_t mouse_if : 1; 24 | uint8_t powerbutton_if : 1; 25 | uint8_t sd_present : 1; 26 | uint8_t headphones_present : 1; 27 | uint8_t i2c_if : 1; 28 | }; 29 | 30 | typedef struct ControlRegister ControlRegister; 31 | struct ControlRegister { 32 | uint8_t keyboard_ie : 1; 33 | uint8_t mouse_ie : 1; 34 | uint8_t powerbutton_ie : 1; 35 | uint8_t sd_ie : 1; 36 | uint8_t headphones_ie : 1; 37 | uint8_t i2c_ie : 1; 38 | }; 39 | 40 | extern StatusRegister reg_status; 41 | extern ControlRegister reg_control; 42 | 43 | void protocol_reset(); 44 | void protocol_tick(); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/hbox.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_HBOX_H 11 | #define MUIL_HBOX_H 12 | 13 | #include "box.h" 14 | 15 | #define MUIL_HBOX_PROP_CHILDREN 0 16 | #define MUIL_HBOX_PROP_SIZE 1 17 | 18 | struct MuilHboxProperties { 19 | MuilWidgetList *children; 20 | int size; 21 | }; 22 | 23 | MuilWidget *muil_widget_create_hbox(); 24 | void *muil_widget_hbox_destroy(MuilWidget* widget); 25 | 26 | void muil_hbox_event_notify_children(MuilWidget *widget, unsigned int type, MuilEvent *e); 27 | 28 | void muil_hbox_add_child(MuilWidget *widget, MuilWidget *child, int expand); 29 | void muil_hbox_remove_child(MuilWidget *widget, MuilWidget *child); 30 | void muil_hbox_set_prop(MuilWidget *widget, int prop, MuilPropertyValue value); 31 | MuilPropertyValue muil_hbox_get_prop(MuilWidget *widget, int prop); 32 | void muil_hbox_resize(MuilWidget *widget, int x, int y, int w, int h); 33 | void muil_hbox_request_size(MuilWidget *widget, int *w, int *h); 34 | void muil_hbox_render(MuilWidget *widget); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/vbox.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_VBOX_H 11 | #define MUIL_VBOX_H 12 | 13 | #include "box.h" 14 | 15 | #define MUIL_VBOX_PROP_CHILDREN 0 16 | #define MUIL_VBOX_PROP_SIZE 1 17 | 18 | struct MuilVboxProperties { 19 | MuilWidgetList *children; 20 | int size; 21 | }; 22 | 23 | MuilWidget *muil_widget_create_vbox(); 24 | void *muil_widget_vbox_destroy(MuilWidget* widget); 25 | 26 | void muil_vbox_event_notify_children(MuilWidget *widget, unsigned int type, MuilEvent *e); 27 | 28 | void muil_vbox_add_child(MuilWidget *widget, MuilWidget *child, int expand); 29 | void muil_vbox_remove_child(MuilWidget *widget, MuilWidget *child); 30 | void muil_vbox_set_prop(MuilWidget *widget, int prop, MuilPropertyValue value); 31 | MuilPropertyValue muil_vbox_get_prop(MuilWidget *widget, int prop); 32 | void muil_vbox_resize(MuilWidget *widget, int x, int y, int w, int h); 33 | void muil_vbox_request_size(MuilWidget *widget, int *w, int *h); 34 | void muil_vbox_render(MuilWidget *widget); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/common/sound/src/sound.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "peripheral.h" 4 | 5 | void sound_setup(void *buf_addr) { 6 | int i; 7 | volatile uint16_t *buf= (volatile uint16_t *) buf_addr; 8 | volatile uint32_t *sound_hw = (volatile uint32_t *) PERIPHERAL_SOUND_BASE; 9 | 10 | for(i = 0; i < 1024; i++) { 11 | buf[i] = 0; 12 | } 13 | 14 | sound_hw[0] = 0x0; 15 | sound_hw[2] = (uint32_t) buf_addr; 16 | sound_hw[3] = 3; 17 | sound_hw[4] = 512; 18 | } 19 | 20 | void sound_start() { 21 | volatile uint32_t *sound_hw = (volatile uint32_t *) PERIPHERAL_SOUND_BASE; 22 | volatile uint32_t *interrupt_hw = (volatile uint32_t *) PERIPHERAL_INTERRUPT_BASE; 23 | interrupt_hw[32 + 11] = 0x0; 24 | sound_hw[0] = 0x1; 25 | } 26 | 27 | void sound_stop() { 28 | volatile uint32_t *sound_hw = (volatile uint32_t *) PERIPHERAL_SOUND_BASE; 29 | volatile uint32_t *interrupt_hw = (volatile uint32_t *) PERIPHERAL_INTERRUPT_BASE; 30 | sound_hw[0] = 0x0; 31 | interrupt_hw[32 + 11] = 0x0; 32 | } 33 | 34 | int sound_wait() { 35 | volatile uint32_t *sound_hw = (volatile uint32_t *) PERIPHERAL_SOUND_BASE; 36 | volatile uint32_t *interrupt_hw = (volatile uint32_t *) PERIPHERAL_INTERRUPT_BASE; 37 | 38 | while(!interrupt_hw[32 + 11]); 39 | interrupt_hw[32 + 11] = 0x0; 40 | 41 | return !(sound_hw[1] & 0x1); 42 | } 43 | -------------------------------------------------------------------------------- /src/misc/bootrom.S: -------------------------------------------------------------------------------- 1 | .text 2 | .int 0x00100000 3 | .int 0x00000008 4 | 5 | nop 6 | 7 | move.l #524288, %d5 8 | move.l #0x0008070f, %d4 9 | 1: 10 | move.l %d4, (%d5) 11 | move.l (%d5), %d4 12 | move.l %d4, (%d5) 13 | addq.l #4, %d5 14 | 15 | cmpi.l #908288, %d5 16 | bne 1b 17 | 18 | move.l #524288, %d5 19 | 2: 20 | move.l 0x00100904,%d0 21 | btst #1,%d0 22 | jeq 2b 23 | 24 | move.l 0x00100900,%d4 25 | 26 | move.b %d4, (%d5) 27 | move.b (%d5), %d4 28 | move.b %d4, (%d5) 29 | 30 | addq.l #1, %d5 31 | 32 | cmpi.l #908288, %d5 33 | bne 2b 34 | 35 | 36 | 2: 37 | move.l #524288, %d5 38 | move.l #525088, %d6 39 | 1: 40 | move.l (%d6), %d4 41 | rol #8, %d4 42 | move.b %d4, (%d5) 43 | addq.l #1, %d5 44 | rol #8, %d4 45 | move.b %d4, (%d5) 46 | addq.l #1, %d5 47 | rol #8, %d4 48 | move.b %d4, (%d5) 49 | addq.l #1, %d5 50 | rol #8, %d4 51 | move.b %d4, (%d5) 52 | addq.l #1, %d5 53 | 54 | addq.l #4, %d6 55 | 56 | cmpi.l #908288, %d5 57 | bne 1b 58 | 59 | bra 2b 60 | 61 | 2: #stop #0x3000 62 | bra 2b 63 | nop 64 | 65 | fail: 66 | move.l #0x04040404, %d4 67 | bra fill 68 | 69 | success: 70 | move.l #0x02020202, %d4 71 | bra fill 72 | 73 | fill: 74 | move.l #524288, %d5 75 | 1: 76 | move.l %d4, (%d5) 77 | addq.l #4, %d5 78 | 79 | cmpi.l #908288, %d5 80 | bne 1b 81 | 2: 82 | bra 2b 83 | -------------------------------------------------------------------------------- /hw/motherboard/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name trollbook-rev2-rescue)(type Legacy)(uri ${KIPRJMOD}/trollbook-rev2-rescue.lib)(options "")(descr "")) 3 | (lib (name MC68040FC33V)(type Legacy)(uri ${KIPRJMOD}/lib/MC68040FC33V.lib)(options "")(descr "")) 4 | (lib (name EPF10K50VRC240)(type Legacy)(uri ${KIPRJMOD}/lib/EPF10K50VRC240.lib)(options "")(descr "")) 5 | (lib (name 39f040)(type Legacy)(uri ${KIPRJMOD}/lib/39f040.lib)(options "")(descr "")) 6 | (lib (name hy57v561620)(type Legacy)(uri ${KIPRJMOD}/lib/hy57v561620.lib)(options "")(descr "")) 7 | (lib (name idt71v416)(type Legacy)(uri ${KIPRJMOD}/lib/idt71v416.lib)(options "")(descr "")) 8 | (lib (name tlc7524)(type Legacy)(uri ${KIPRJMOD}/lib/tlc7524.lib)(options "")(descr "")) 9 | (lib (name as7c34098)(type Legacy)(uri ${KIPRJMOD}/lib/as7c34098.lib)(options "")(descr "")) 10 | (lib (name s25fl204k0tmfi010)(type Legacy)(uri ${KIPRJMOD}/lib/s25fl204k0tmfi010.lib)(options "")(descr "")) 11 | (lib (name epc2)(type Legacy)(uri ${KIPRJMOD}/lib/epc2.lib)(options "")(descr "")) 12 | (lib (name er-con40ht-1)(type Legacy)(uri ${KIPRJMOD}/lib/er-con40ht-1.lib)(options "")(descr "")) 13 | (lib (name ada4851-4)(type Legacy)(uri ${KIPRJMOD}/lib/ada4851-4.lib)(options "")(descr "")) 14 | (lib (name osc)(type Legacy)(uri ${KIPRJMOD}/lib/osc.lib)(options "")(descr "")) 15 | ) 16 | -------------------------------------------------------------------------------- /src/common/draw/src/font.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | DrawFont *draw_font_new(void *mem, unsigned int glyph_width, unsigned int glyph_height) { 6 | DrawFont *font = NULL; 7 | 8 | if(!(font = malloc(sizeof(DrawFont)))) 9 | goto fail; 10 | 11 | font->mem = mem; 12 | font->glyph_width = glyph_width; 13 | font->glyph_height = glyph_height; 14 | 15 | return font; 16 | 17 | fail: 18 | return NULL; 19 | } 20 | 21 | void draw_font_free(DrawFont *font) { 22 | free(font); 23 | } 24 | 25 | int draw_font_string_geometrics(DrawFont *font, char *s, int max_line_w, int *text_w, int *text_h) { 26 | int lines; 27 | 28 | if(!font || !s) 29 | return -1; 30 | 31 | lines = (strlen(s) + (max_line_w - 1))/max_line_w; 32 | if(lines == 0) 33 | lines = 1; 34 | 35 | if(text_w) { 36 | if(lines == 1) 37 | *text_w = font->glyph_width * strlen(s); 38 | else 39 | *text_w = font->glyph_width * max_line_w; 40 | } 41 | 42 | if(text_h) { 43 | *text_h = font->glyph_height * lines; 44 | } 45 | 46 | return 0; 47 | } 48 | 49 | int draw_font_glyph_h(DrawFont *font) { 50 | if(!font) 51 | return -1; 52 | 53 | return font->glyph_height; 54 | } 55 | 56 | int draw_font_string_w(DrawFont *font, char *s) { 57 | if(!font) 58 | return -1; 59 | 60 | return font->glyph_width * strlen(s); 61 | } 62 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/checkbox.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_CHECKBOX_H 11 | #define MUIL_CHECKBOX_H 12 | 13 | #define MUIL_CHECKBOX_PROP_ACTIVATED 0 14 | #define MUIL_CHECKBOX_PROP_BORDER 1 15 | #define MUIL_CHECKBOX_PROP_ACTIVE_BORDER 2 16 | 17 | struct MuilCheckboxProperties { 18 | int activated; 19 | DrawRectSet *background; 20 | DrawLineSet *border; 21 | DrawLineSet *active_border; 22 | }; 23 | 24 | MuilWidget *muil_widget_create_checkbox(); 25 | void *muil_widget_destroy_checkbox(MuilWidget *widget); 26 | 27 | void muil_checkbox_event_click(MuilWidget *widget, unsigned int type, MuilEvent *e); 28 | void muil_checkbox_event_key(MuilWidget *widget, unsigned int type, MuilEvent *e); 29 | 30 | void muil_checkbox_set_prop(MuilWidget *widget, int prop, MuilPropertyValue value); 31 | MuilPropertyValue muil_checkbox_get_prop(MuilWidget *widget, int prop); 32 | void muil_checkbox_resize(MuilWidget *widget, int x, int y, int w, int h); 33 | void muil_checkbox_request_size(MuilWidget *widget, int *w, int *h); 34 | void muil_checkbox_render(MuilWidget *widget); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/amp.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # LM2904ST 5 | # 6 | DEF LM2904ST U 0 40 Y Y 2 F N 7 | F0 "U" -250 -50 60 H V C CNN 8 | F1 "LM2904ST" -250 50 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | DRAW 12 | P 4 0 1 0 500 0 -500 500 -500 -500 500 0 N 13 | X VEE 4 0 -450 200 U 50 50 0 1 W 14 | X VCC 8 0 450 200 D 50 50 0 1 W 15 | X OUT 1 700 0 200 L 50 50 1 1 O 16 | X IN- 2 -700 200 200 R 50 50 1 1 I 17 | X IN+ 3 -700 -200 200 R 50 50 1 1 I 18 | X IN+ 5 -700 -200 200 R 50 50 2 1 I 19 | X IN- 6 -700 200 200 R 50 50 2 1 I 20 | X OUT 7 700 0 200 L 50 50 2 1 O 21 | ENDDRAW 22 | ENDDEF 23 | # 24 | # TCA0372 25 | # 26 | DEF TCA0372 U 0 40 Y Y 2 F N 27 | F0 "U" 0 -50 60 H V C CNN 28 | F1 "TCA0372" 0 50 60 H V C CNN 29 | F2 "" 0 0 60 H I C CNN 30 | F3 "" 0 0 60 H I C CNN 31 | DRAW 32 | P 3 0 1 0 -400 -250 -400 -550 650 0 N 33 | P 3 0 1 0 650 0 -400 550 -400 -250 N 34 | X VCC 1 0 550 200 D 50 50 0 1 W 35 | X VEE 4 -100 -600 200 U 50 50 0 1 W 36 | X VEE 5 0 -550 200 U 50 50 0 1 W 37 | X VEE 12 100 -500 200 U 50 50 0 1 W 38 | X VEE 13 200 -450 200 U 50 50 0 1 W 39 | X IN+ 9 -600 -250 200 R 50 50 1 1 I 40 | X IN- 10 -600 200 200 R 50 50 1 1 I 41 | X OUT 16 850 0 200 L 50 50 1 1 O 42 | X OUT 2 850 0 200 L 50 50 2 1 O 43 | X IN- 7 -600 200 200 R 50 50 2 1 I 44 | X IN+ 8 -600 -250 200 R 50 50 2 1 I 45 | ENDDRAW 46 | ENDDEF 47 | # 48 | #End Library 49 | -------------------------------------------------------------------------------- /src/common/util/src/delay.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "peripheral.h" 3 | #include "delay.h" 4 | 5 | void dumbdelay(volatile uint32_t t) { 6 | while(t--); 7 | } 8 | 9 | 10 | void delay_timer_set_prescale(uint16_t prescaler) { 11 | volatile uint32_t *timer_base = (volatile uint32_t *) PERIPHERAL_TIMER_BASE; 12 | 13 | timer_base[0] = (timer_base[0] & 0x3) | (prescaler << 16); 14 | } 15 | 16 | 17 | void delay_timer(int timer, int32_t msec) { 18 | int prescaler, iterations, i; 19 | volatile uint32_t *timer_base = (volatile uint32_t *) PERIPHERAL_TIMER_BASE; 20 | 21 | msec = msec * 100000 / 3; 22 | prescaler = timer_base[0] >> 16; 23 | msec /= prescaler; 24 | iterations = msec >> 16; 25 | timer_base[0] = timer_base[0] & (~(1 << timer)); 26 | 27 | for (i = 0; i < iterations; i++) { 28 | // Turn off the timer 29 | timer_base[4 * (timer + 1)] = 0; 30 | // Clear interrupt flag 31 | timer_base[1] = (1 << timer); 32 | 33 | timer_base[4 * (timer + 1) + 2] = 65535; 34 | 35 | timer_base[4 * (timer + 1)] = 1; 36 | 37 | while (!(timer_base[1] & (1 << timer))); 38 | } 39 | 40 | timer_base[4 * (timer + 1)] = 0; 41 | timer_base[1] = timer_base[1] & (1 << timer); 42 | timer_base[4 * (timer + 1) + 2] = msec & 0xFFFF; 43 | timer_base[4 * (timer + 1)] = 1; 44 | 45 | while (!(timer_base[1] & (1 << timer))); 46 | timer_base[4 * (timer + 1)] = 0; 47 | 48 | return; 49 | } 50 | -------------------------------------------------------------------------------- /hdl/trollbook.qpf: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------------- # 2 | # 3 | # Copyright (C) 1991-2009 Altera Corporation 4 | # Your use of Altera Corporation's design tools, logic functions 5 | # and other software and tools, and its AMPP partner logic 6 | # functions, and any output files from any of the foregoing 7 | # (including device programming or simulation files), and any 8 | # associated documentation or information are expressly subject 9 | # to the terms and conditions of the Altera Program License 10 | # Subscription Agreement, Altera MegaCore Function License 11 | # Agreement, or other applicable license agreement, including, 12 | # without limitation, that your use is for the sole purpose of 13 | # programming logic devices manufactured by Altera and sold by 14 | # Altera or its authorized distributors. Please refer to the 15 | # applicable agreement for further details. 16 | # 17 | # -------------------------------------------------------------------------- # 18 | # 19 | # Quartus II 20 | # Version 9.0 Build 235 06/17/2009 Service Pack 2 SJ Web Edition 21 | # Date created = 23:23:06 March 23, 2016 22 | # 23 | # -------------------------------------------------------------------------- # 24 | 25 | QUARTUS_VERSION = "9.0" 26 | DATE = "23:23:06 March 23, 2016" 27 | 28 | # Revisions 29 | 30 | PROJECT_REVISION = "trollbook" 31 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/slider.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_SLIDER_H 11 | #define MUIL_SLIDER_H 12 | 13 | #define MUIL_SLIDER_PROP_LINE 1 14 | #define MUIL_SLIDER_PROP_HANDLE 2 15 | #define MUIL_SLIDER_PROP_VALUE 3 16 | #define MUIL_SLIDER_PROP_STEPS 4 17 | 18 | struct MuilSliderProperties { 19 | DrawRectSet *background; 20 | DrawLineSet *line; 21 | DrawRectSet *handle; 22 | unsigned int value; 23 | unsigned int steps; 24 | }; 25 | 26 | MuilWidget *muil_widget_create_slider(unsigned int steps); 27 | void *muil_widget_destroy_slider(MuilWidget *widget); 28 | 29 | void muil_slider_event_mouse_down(MuilWidget *widget, unsigned int type, MuilEvent *e); 30 | void muil_slider_event_mouse_release(MuilWidget *widget, unsigned int type, MuilEvent *e); 31 | 32 | void muil_slider_set_prop(MuilWidget *widget, int prop, MuilPropertyValue value); 33 | MuilPropertyValue muil_slider_get_prop(MuilWidget *widget, int prop); 34 | void muil_slider_resize(MuilWidget *widget, int x, int y, int w, int h); 35 | void muil_slider_request_size(MuilWidget *widget, int *w, int *h); 36 | void muil_slider_render(MuilWidget *widget); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/progressbar.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_PROGRESSBAR_H 11 | #define MUIL_PROGRESSBAR_H 12 | 13 | #define MUIL_PROGRESSBAR_PROP_FONT 0 14 | #define MUIL_PROGRESSBAR_PROP_SURFACE 1 15 | #define MUIL_PROGRESSBAR_PROP_BORDER 2 16 | #define MUIL_PROGRESSBAR_PROP_BAR 3 17 | #define MUIL_PROGRESSBAR_PROP_PROGRESS 4 18 | #define MUIL_PROGRESSBAR_PROP_TEXT 5 19 | 20 | struct MuilProgressbarProperties { 21 | DrawFont *font; 22 | DrawTextSurface *surface; 23 | DrawRectSet *background; 24 | DrawLineSet *border; 25 | DrawRectSet *bar; 26 | int progress; 27 | char text[5]; 28 | }; 29 | 30 | MuilWidget *muil_widget_create_progressbar(DrawFont *font); 31 | void *muil_widget_destroy_progressbar(MuilWidget *widget); 32 | 33 | void muil_progressbar_set_prop(MuilWidget *widget, int prop, MuilPropertyValue value); 34 | MuilPropertyValue muil_progressbar_get_prop(MuilWidget *widget, int prop); 35 | void muil_progressbar_resize(MuilWidget *widget, int x, int y, int w, int h); 36 | void muil_progressbar_request_size(MuilWidget *widget, int *w, int *h); 37 | void muil_progressbar_render(MuilWidget *widget); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/imageview.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_IMAGEVIEW_H 11 | #define MUIL_IMAGEVIEW_H 12 | 13 | #define MUIL_IMAGEVIEW_PROP_BITMAP 0 14 | #define MUIL_IMAGEVIEW_PROP_BORDER 1 15 | #define MUIL_IMAGEVIEW_PROP_IMAGE_WIDTH 2 16 | #define MUIL_IMAGEVIEW_PROP_IMAGE_HEIGHT 3 17 | 18 | struct MuilImageviewProperties { 19 | DrawRectSet *background; 20 | DrawBitmap *bitmap; 21 | DrawLineSet *border; 22 | int image_w; 23 | int image_h; 24 | }; 25 | 26 | MuilWidget *muil_widget_create_imageview(); 27 | MuilWidget *muil_widget_create_imageview_raw(int w, int h); 28 | //MuilWidget *muil_widget_create_imageview_file(const char *filename, int w, int h, int pixel_format); 29 | void *muil_widget_destroy_imageview(MuilWidget *widget); 30 | 31 | MuilPropertyValue muil_imageview_get_prop(MuilWidget *widget, int prop); 32 | void muil_imageview_set_prop(MuilWidget *widget, int prop, MuilPropertyValue value); 33 | void muil_imageview_request_size(MuilWidget *widget, int *w, int *h); 34 | void muil_imageview_resize(MuilWidget *widget, int x, int y, int w, int h); 35 | void muil_imageview_render(MuilWidget *widget); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/misc/fontconv/fontconv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | int main(int argc, char **argv) { 8 | FILE *out; 9 | int i, j, k, glyphs, t, w; 10 | uint32_t data; 11 | uint8_t *ptr; 12 | SDL_Surface *tex; 13 | 14 | int glyph_w, glyph_h; 15 | 16 | if (argc != 5) { 17 | fprintf(stderr, "Invalid amount of arguments!\n"); 18 | printf("Usage: font_convert \n"); 19 | return -1; 20 | } 21 | 22 | glyph_w = atoi(argv[3]); 23 | glyph_h = atoi(argv[4]); 24 | 25 | if ((out = fopen(argv[2], "w")) == NULL) { 26 | fprintf(stderr, "Failed to open file %s for writing+trunc!\n", argv[2]); 27 | return -1; 28 | } 29 | 30 | if ((tex = IMG_Load(argv[1])) == NULL) { 31 | printf("Failed to load %s\n", argv[1]); 32 | return 0; 33 | } 34 | 35 | fprintf(stderr, "%i\n", tex->format->BytesPerPixel); 36 | 37 | glyphs = tex->w / glyph_w; 38 | ptr = tex->pixels; 39 | w = tex->w + (tex->w % 4); 40 | for (i = 0; i < glyphs; i++) { 41 | for (j = 0; j < glyph_h; j++) { 42 | data = 0; 43 | for (k = 0; k < glyph_w; k++) { 44 | t = i * glyph_w + j * w + k; 45 | if(ptr[t]) 46 | data |= (1 << k); 47 | // fprintf(stderr, "%i,%i,%i;; %i, %i, %i\n", i, j, k, t, ptr[t], data); 48 | } 49 | fwrite(&data, 1, 1, out); 50 | } 51 | } 52 | 53 | fclose(out); 54 | 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /src/common/file-io/include/fat.h: -------------------------------------------------------------------------------- 1 | #ifndef __FAT_H__ 2 | #define __FAT_H__ 3 | 4 | #include 5 | #include 6 | 7 | #define O_WRONLY 2 8 | #define O_RDONLY 1 9 | #define O_RDWR (O_RDONLY | O_WRONLY) 10 | 11 | typedef enum FATType FATType; 12 | enum FATType { 13 | FAT_TYPE_FAT16, 14 | FAT_TYPE_FAT32, 15 | }; 16 | 17 | struct FATDirList { 18 | char filename[13]; 19 | uint8_t attrib; 20 | uint8_t padding[2]; 21 | } __attribute__((packed)); 22 | 23 | int fat_init(int (* read_sector_call)(uint32_t sector, uint8_t *data), int (* write_sector_call)(uint32_t sector, uint8_t *data), uint8_t *buffer); 24 | void fat_close(int fd); 25 | int fat_open(const char *path, int flags); 26 | uint32_t fat_fsize(int fd); 27 | uint32_t fat_ftell(int fd); 28 | bool fat_read_sect(int fd); 29 | bool fat_write_sect(int fd); 30 | bool fat_delete_file(const char *path); 31 | bool fat_create_file(char *path, char *name, uint8_t attrib); 32 | uint8_t fat_get_stat(const char *path); 33 | void fat_set_stat(const char *path, uint8_t stat); 34 | void fat_set_fsize(const char *path, uint32_t size); 35 | int fat_dirlist(const char *path, struct FATDirList *list, int size, int skip); 36 | bool fat_valid(); 37 | FATType fat_type(); 38 | int fat_get_label(char *buf); 39 | 40 | /* These should be provided by you */ 41 | /* Returns < 0 on error */ 42 | //int write_sector_call(uint32_t sector, uint8_t *data); 43 | //int read_sector_call(uint32_t sector, uint8_t *data); 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/demos/trololo/src/demo.c: -------------------------------------------------------------------------------- 1 | #include "terminal.h" 2 | #include "fat.h" 3 | #include "wav.h" 4 | #include "printf.h" 5 | #include "mem.h" 6 | #include "main.h" 7 | 8 | uint8_t wavbuf[17*1024*1024]; 9 | 10 | void demo_run() { 11 | int i, j, fd; 12 | uint32_t size; 13 | volatile uint32_t *src, *dst; 14 | volatile uint8_t *tmp; 15 | uint8_t *wav_buffer; 16 | 17 | //terminal_clear(); 18 | 19 | 20 | fd = fat_open("/TROLOLO.WAV", O_RDONLY); 21 | printf("opening file trololo.wav %i\n", fd); 22 | size = fat_fsize(fd); 23 | 24 | printf("allocating %u bytes\n", size); 25 | //dst = malloc(size); 26 | dst = (uint32_t *) wavbuf; 27 | memset(wavbuf, 0, size); 28 | printf("successfully allocated %u bytes\n", size); 29 | wav_buffer = (uint8_t *) dst; 30 | for(j = 0; j < size; j += 512) { 31 | fat_read_sect(fd); 32 | src = (uint32_t *) fat_buf; 33 | for(i = 0; i < 512/4; i++) { 34 | *dst++ = *src++; 35 | } 36 | //printf("\r%u/%u kB", j >> 10, size >> 10); 37 | } 38 | fat_close(fd); 39 | 40 | fd = fat_open("/TROLOLO.BIN", O_RDONLY); 41 | size = fat_fsize(fd); 42 | dst = MEM_VGA_RAM; 43 | 44 | for(j = 512; j < size; j += 512) { 45 | fat_read_sect(fd); 46 | src = (uint32_t *) fat_buf; 47 | for(i = 0; i < 512/4; i++) { 48 | *dst++ = *src++; 49 | } 50 | } 51 | fat_read_sect(fd); 52 | tmp = (uint8_t *) dst; 53 | for(i = 0; i < j - size; i++) { 54 | *tmp++ = fat_buf[i]; 55 | } 56 | 57 | fat_close(fd); 58 | 59 | wav_play(wav_buffer); 60 | } 61 | -------------------------------------------------------------------------------- /hw/peripheral-board/out/peripheral-board-Edge.Cuts.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,no-vcs-found-2f9be81~58~ubuntu16.04.1* 2 | G04 #@! TF.CreationDate,2017-04-05T21:19:04+02:00* 3 | G04 #@! TF.ProjectId,peripheral-board,7065726970686572616C2D626F617264,rev?* 4 | G04 #@! TF.FileFunction,Profile,NP* 5 | %FSLAX46Y46*% 6 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 7 | G04 Created by KiCad (PCBNEW no-vcs-found-2f9be81~58~ubuntu16.04.1) date Wed Apr 5 21:19:04 2017* 8 | %MOMM*% 9 | %LPD*% 10 | G01* 11 | G04 APERTURE LIST* 12 | %ADD10C,0.100000*% 13 | %ADD11C,0.150000*% 14 | G04 APERTURE END LIST* 15 | D10* 16 | D11* 17 | X95100000Y33500000D02* 18 | X100000000Y33500000D01* 19 | X95100000Y42200000D02* 20 | X95100000Y33500000D01* 21 | X100000000Y42200000D02* 22 | X95100000Y42200000D01* 23 | X100000000Y33500000D02* 24 | X100000000Y42200000D01* 25 | X89000000Y39500000D02* 26 | X92000000Y36500000D01* 27 | X73000000Y36500000D02* 28 | X76000000Y39500000D01* 29 | X76000000Y20500000D02* 30 | X73000000Y23500000D01* 31 | X92000000Y23500000D02* 32 | X89000000Y20500000D01* 33 | X73000000Y23500000D02* 34 | X73000000Y36500000D01* 35 | X89000000Y20500000D02* 36 | X76000000Y20500000D01* 37 | X92000000Y36500000D02* 38 | X92000000Y23500000D01* 39 | X76000000Y39500000D02* 40 | X89000000Y39500000D01* 41 | X0Y100000000D02* 42 | X0Y0D01* 43 | X165000000Y0D02* 44 | X0Y0D01* 45 | X165000000Y100000000D02* 46 | X165000000Y0D01* 47 | X0Y100000000D02* 48 | X165000000Y100000000D01* 49 | M02* 50 | -------------------------------------------------------------------------------- /src/demos/tsko/src/gfx.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static unsigned screen_w; 6 | static uint32_t vgactrlreg; 7 | 8 | void gfx_set_lowres() { 9 | volatile uint32_t *vga_hw = (volatile uint32_t *) PERIPHERAL_VGA_BASE; 10 | vga_hw[0] = 0x3; 11 | vgactrlreg = 0x3; 12 | screen_w = 400; 13 | //input_poll(); 14 | //vga_hw[0] = 0x7; //flip buffer 15 | //input_poll(); 16 | } 17 | 18 | void gfx_buffer_flip() { 19 | volatile uint32_t *vga_hw = (volatile uint32_t *) PERIPHERAL_VGA_BASE; 20 | 21 | if(vgactrlreg == 0x3) { 22 | vgactrlreg = 0x7; 23 | } else { 24 | vgactrlreg = 0x3; 25 | } 26 | vga_hw[0] = vgactrlreg; 27 | } 28 | 29 | void gfx_blit(void *image, int width, int x, int y) { 30 | 31 | } 32 | 33 | void gfx_blit_fast(void *image, unsigned width, unsigned height, unsigned x, unsigned y) { 34 | uint32_t *from; 35 | uint32_t *to; 36 | uint32_t data; 37 | unsigned initial_x; 38 | unsigned i, j; 39 | 40 | from = image; 41 | if(vgactrlreg == 0x3) { 42 | to = (void *) (0x00080000UL + 0x20000UL + y*screen_w); 43 | } else { 44 | to = (void *) (0x00080000UL + y*screen_w); 45 | } 46 | 47 | width = width >> 2; 48 | height = height; 49 | x = x >> 2; 50 | 51 | i = 0; 52 | j = 0; 53 | 54 | for(;;) { 55 | data = *from++; 56 | to[x + i] = data; 57 | 58 | if(++i == width) { 59 | i = 0; 60 | if(++j == height) 61 | return; 62 | 63 | to += (screen_w >> 2); 64 | } 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /hw/display-board/displayboard.pro: -------------------------------------------------------------------------------- 1 | update=ons 5 apr 2017 21:27:49 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [eeschema] 27 | version=1 28 | LibDir= 29 | [eeschema/libraries] 30 | LibName1=power 31 | LibName2=device 32 | LibName3=transistors 33 | LibName4=conn 34 | LibName5=linear 35 | LibName6=regul 36 | LibName7=74xx 37 | LibName8=cmos4000 38 | LibName9=adc-dac 39 | LibName10=memory 40 | LibName11=xilinx 41 | LibName12=microcontrollers 42 | LibName13=dsp 43 | LibName14=microchip 44 | LibName15=analog_switches 45 | LibName16=motorola 46 | LibName17=texas 47 | LibName18=intel 48 | LibName19=audio 49 | LibName20=interface 50 | LibName21=digital-audio 51 | LibName22=philips 52 | LibName23=display 53 | LibName24=cypress 54 | LibName25=siliconi 55 | LibName26=opto 56 | LibName27=atmel 57 | LibName28=contrib 58 | LibName29=valves 59 | LibName30=lib/er-con40ht-1 60 | [general] 61 | version=1 62 | -------------------------------------------------------------------------------- /src/common/muil/src/ui.c: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #include 11 | #include 12 | 13 | int muil_padding; 14 | MuilWidget *muil_selected_widget; 15 | struct MuilPaneList muil_panelist_dialogue; 16 | 17 | MuilColor muil_color = { 18 | .window_border = 8, 19 | .window_background = 7, 20 | .widget_border = 8, 21 | .widget_background = 15, 22 | .text = 0, 23 | .selected = 1, 24 | }; 25 | 26 | void muil_init(int padding) { 27 | muil_padding = padding; 28 | muil_selected_widget = NULL; 29 | muil_e_m_prev.x =muil_e_m_prev.y =muil_e_m_prev.buttons =muil_e_m_prev.wheel = 0; 30 | muil_panelist_dialogue.next = NULL; 31 | muil_panelist_dialogue.pane = NULL; 32 | //d_input_unicode(1); 33 | 34 | //*((volatile uint32_t *) (PERIPHERAL_VGA_BASE + 0x20)) = 0x0; 35 | //for(int i = 0; i < 8*16; i++) 36 | // *((volatile uint32_t *) (PERIPHERAL_VGA_BASE + 0x24)) = 0x3; 37 | } 38 | 39 | void *muil_widget_destroy(MuilWidget *widget) { 40 | struct MuilEventHandlerList *h, *next; 41 | if(widget->event_handler) 42 | for(h = widget->event_handler->handlers; h; h = next) { 43 | next = h->next; 44 | free(h); 45 | } 46 | free(widget->event_handler); 47 | free(widget->properties); 48 | free(widget); 49 | return NULL; 50 | } 51 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/SMD-TACT-5.2x5.2x2mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SMD-TACT-5.2x5.2x2mm (layer F.Cu) (tedit 581DC508) 2 | (fp_text reference REF** (at 0 4) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value SMD-TACT-5.2x5.2x2mm (at 0 -3.6) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start 2.05 1) (end 2.05 -1) (layer F.SilkS) (width 0.15)) 9 | (fp_line (start -1 2.05) (end 1 2.05) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start -2.05 -1) (end -2.05 1) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start -1 -2.05) (end 1.1 -2.05) (layer F.SilkS) (width 0.15)) 12 | (fp_circle (center 0 0) (end 0 -1.1) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start -1.45 2.6) (end 1.45 2.6) (layer F.SilkS) (width 0.15)) 14 | (fp_line (start -1.45 -2.6) (end 1.45 -2.6) (layer F.SilkS) (width 0.15)) 15 | (fp_line (start 2.6 -1.05) (end 2.6 1.05) (layer F.SilkS) (width 0.15)) 16 | (fp_line (start -2.6 1.05) (end -2.6 -1.05) (layer F.SilkS) (width 0.15)) 17 | (pad 2 smd rect (at -2.6 1.85) (size 1.8 1.1) (layers F.Cu F.Paste F.Mask)) 18 | (pad 1 smd rect (at -2.6 -1.85) (size 1.8 1.1) (layers F.Cu F.Paste F.Mask)) 19 | (pad 2 smd rect (at 2.6 1.85) (size 1.8 1.1) (layers F.Cu F.Paste F.Mask)) 20 | (pad 1 smd rect (at 2.6 -1.85) (size 1.8 1.1) (layers F.Cu F.Paste F.Mask)) 21 | (model ${KIPRJMOD}/lib/smd-tac-5.2x5.2x2mm.step 22 | (at (xyz 0 0 0)) 23 | (scale (xyz 1 1 1)) 24 | (rotate (xyz 0 0 0)) 25 | ) 26 | ) 27 | -------------------------------------------------------------------------------- /hw/peripheral-board/lib/ACJS-NH35.kicad_mod: -------------------------------------------------------------------------------- 1 | (module ACJS-NH35 (layer F.Cu) (tedit 589B6020) 2 | (fp_text reference REF** (at -21.5 9) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value ACJS-NH35 (at -18.75 7) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start 0 0) (end 0 -8) (layer F.SilkS) (width 0.15)) 9 | (fp_line (start 0 -8) (end -23.4 -8) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start -23.4 -8) (end -23.4 8) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start -23.4 8) (end 0 8) (layer F.SilkS) (width 0.15)) 12 | (fp_line (start 0 8) (end 0 0) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start 0 -2.75) (end 3 -2.75) (layer F.SilkS) (width 0.15)) 14 | (fp_line (start 3 -2.75) (end 3 2.75) (layer F.SilkS) (width 0.15)) 15 | (fp_line (start 3 2.75) (end 0 2.75) (layer F.SilkS) (width 0.15)) 16 | (fp_line (start 1.75 -2.75) (end 1.75 2.75) (layer F.SilkS) (width 0.15)) 17 | (pad 1 thru_hole circle (at -2.7 3.4) (size 2.5 2.5) (drill 1.5) (layers *.Cu *.Mask)) 18 | (pad 2 thru_hole circle (at -5.6 3.4) (size 2.5 2.5) (drill 1.5) (layers *.Cu *.Mask)) 19 | (pad 3 thru_hole circle (at -9.2 3.4) (size 2.5 2.5) (drill 1.5) (layers *.Cu *.Mask)) 20 | (pad 4 thru_hole circle (at -2.7 -3.4) (size 2.5 2.5) (drill 1.5) (layers *.Cu *.Mask)) 21 | (pad 5 thru_hole circle (at -5.6 -3.4) (size 2.5 2.5) (drill 1.5) (layers *.Cu *.Mask)) 22 | (pad 6 thru_hole circle (at -9.2 -3.4) (size 2.5 2.5) (drill 1.5) (layers *.Cu *.Mask)) 23 | ) 24 | -------------------------------------------------------------------------------- /hw/peripheral-board/battery.pro.v4: -------------------------------------------------------------------------------- 1 | update=fre 12 jan 2018 09:39:20 2 | version=1 3 | last_client=eeschema 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | [eeschema/libraries] 32 | LibName1=battery-rescue 33 | LibName2=power 34 | LibName3=device 35 | LibName4=transistors 36 | LibName5=conn 37 | LibName6=linear 38 | LibName7=regul 39 | LibName8=74xx 40 | LibName9=cmos4000 41 | LibName10=adc-dac 42 | LibName11=memory 43 | LibName12=xilinx 44 | LibName13=microcontrollers 45 | LibName14=dsp 46 | LibName15=microchip 47 | LibName16=analog_switches 48 | LibName17=motorola 49 | LibName18=texas 50 | LibName19=intel 51 | LibName20=audio 52 | LibName21=interface 53 | LibName22=digital-audio 54 | LibName23=philips 55 | LibName24=display 56 | LibName25=cypress 57 | LibName26=siliconi 58 | LibName27=opto 59 | LibName28=atmel 60 | LibName29=contrib 61 | LibName30=valves 62 | LibName31=lib/vref 63 | LibName32=references 64 | -------------------------------------------------------------------------------- /src/common/peripheral/include/input.h: -------------------------------------------------------------------------------- 1 | #ifndef INPUT_H_ 2 | #define INPUT_H_ 3 | 4 | #include 5 | #include 6 | 7 | typedef enum InputKey InputKey; 8 | enum InputKey { 9 | INPUT_KEY_NONE = 0, 10 | 11 | INPUT_KEY_BACKSPACE = 8, 12 | INPUT_KEY_TAB = 9, 13 | INPUT_KEY_RETURN = 13, 14 | INPUT_KEY_ESC = 27, 15 | INPUT_KEY_SPACE = 32, 16 | 17 | INPUT_KEY_LMB = 0x80, 18 | INPUT_KEY_MMB, 19 | INPUT_KEY_RMB, 20 | 21 | INPUT_KEY_UP, 22 | INPUT_KEY_DOWN, 23 | INPUT_KEY_LEFT, 24 | INPUT_KEY_RIGHT, 25 | 26 | INPUT_KEY_LCTRL, 27 | INPUT_KEY_LALT, 28 | INPUT_KEY_LTROLL, 29 | INPUT_KEY_LSHIFT, 30 | INPUT_KEY_LFN, 31 | 32 | INPUT_KEY_RCTRL, 33 | INPUT_KEY_RALT, 34 | INPUT_KEY_RTROLL, 35 | INPUT_KEY_RSHIFT, 36 | INPUT_KEY_RFN, 37 | 38 | INPUT_KEY_KP_ENTER 39 | }; 40 | 41 | typedef enum InputKeyboardEventType InputKeyboardEventType; 42 | enum InputKeyboardEventType { 43 | INPUT_KEYBOARD_EVENT_TYPE_NONE, 44 | INPUT_KEYBOARD_EVENT_TYPE_PRESS, 45 | INPUT_KEYBOARD_EVENT_TYPE_RELEASE, 46 | }; 47 | 48 | typedef struct InputKeyboardEvent InputKeyboardEvent; 49 | struct InputKeyboardEvent { 50 | InputKeyboardEventType type; 51 | InputKey keysym; 52 | //char unicode[5]; 53 | }; 54 | 55 | typedef struct InputMouseEvent InputMouseEvent; 56 | struct InputMouseEvent { 57 | int16_t x; 58 | int16_t y; 59 | uint8_t buttons; 60 | int8_t wheel; 61 | }; 62 | 63 | 64 | void input_keyboard_event_push(uint8_t ev); 65 | InputKeyboardEvent input_keyboard_event_pop(); 66 | InputMouseEvent input_mouse_get(); 67 | void input_poll(); 68 | 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /hw/motherboard/lib/39f040.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # 39F040 5 | # 6 | DEF 39F040 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -350 60 H V C CNN 8 | F1 "39F040" 0 300 60 H V C CNN 9 | F2 "" 0 -100 60 H V C CNN 10 | F3 "" 0 -100 60 H V C CNN 11 | DRAW 12 | S -600 950 650 -1050 0 1 0 N 13 | X A18 1 -900 -950 300 R 50 50 1 1 I 14 | X A16 2 -900 -750 300 R 50 50 1 1 I 15 | X A15 3 -900 -650 300 R 50 50 1 1 I 16 | X A12 4 -900 -350 300 R 50 50 1 1 I 17 | X A7 5 -900 150 300 R 50 50 1 1 I 18 | X A6 6 -900 250 300 R 50 50 1 1 I 19 | X A5 7 -900 350 300 R 50 50 1 1 I 20 | X A4 8 -900 450 300 R 50 50 1 1 I 21 | X A3 9 -900 550 300 R 50 50 1 1 I 22 | X A2 10 -900 650 300 R 50 50 1 1 I 23 | X D6 20 950 250 300 L 50 50 1 1 B 24 | X A17 30 -900 -850 300 R 50 50 1 1 I 25 | X A1 11 -900 750 300 R 50 50 1 1 I 26 | X D7 21 950 150 300 L 50 50 1 1 B 27 | X ~WE 31 950 -550 300 L 50 50 1 1 I 28 | X A0 12 -900 850 300 R 50 50 1 1 I 29 | X ~CE 22 950 -850 300 L 50 50 1 1 I 30 | X VCC 32 0 1250 300 D 50 50 1 1 W 31 | X D0 13 950 850 300 L 50 50 1 1 B 32 | X A10 23 -900 -150 300 R 50 50 1 1 I 33 | X D1 14 950 750 300 L 50 50 1 1 B 34 | X ~OE 24 950 -650 300 L 50 50 1 1 I 35 | X D2 15 950 650 300 L 50 50 1 1 B 36 | X A11 25 -900 -250 300 R 50 50 1 1 I 37 | X GND 16 0 -1350 300 U 50 50 1 1 W 38 | X A9 26 -900 -50 300 R 50 50 1 1 I 39 | X D3 17 950 550 300 L 50 50 1 1 B 40 | X A8 27 -900 50 300 R 50 50 1 1 I 41 | X D4 18 950 450 300 L 50 50 1 1 B 42 | X A13 28 -900 -450 300 R 50 50 1 1 I 43 | X D5 19 950 350 300 L 50 50 1 1 B 44 | X A14 29 -900 -550 300 R 50 50 1 1 I 45 | ENDDRAW 46 | ENDDEF 47 | # 48 | #End Library 49 | -------------------------------------------------------------------------------- /hw/display-board/lib/39f040.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # 39F040 5 | # 6 | DEF 39F040 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -350 60 H V C CNN 8 | F1 "39F040" 0 300 60 H V C CNN 9 | F2 "" 0 -100 60 H V C CNN 10 | F3 "" 0 -100 60 H V C CNN 11 | DRAW 12 | S -600 950 650 -1050 0 1 0 N 13 | X A18 1 -900 -950 300 R 50 50 1 1 I 14 | X A16 2 -900 -750 300 R 50 50 1 1 I 15 | X A15 3 -900 -650 300 R 50 50 1 1 I 16 | X A12 4 -900 -350 300 R 50 50 1 1 I 17 | X A7 5 -900 150 300 R 50 50 1 1 I 18 | X A6 6 -900 250 300 R 50 50 1 1 I 19 | X A5 7 -900 350 300 R 50 50 1 1 I 20 | X A4 8 -900 450 300 R 50 50 1 1 I 21 | X A3 9 -900 550 300 R 50 50 1 1 I 22 | X A2 10 -900 650 300 R 50 50 1 1 I 23 | X D6 20 950 250 300 L 50 50 1 1 B 24 | X A17 30 -900 -850 300 R 50 50 1 1 I 25 | X A1 11 -900 750 300 R 50 50 1 1 I 26 | X D7 21 950 150 300 L 50 50 1 1 B 27 | X ~WE 31 950 -550 300 L 50 50 1 1 I 28 | X A0 12 -900 850 300 R 50 50 1 1 I 29 | X ~CE 22 950 -850 300 L 50 50 1 1 I 30 | X VCC 32 0 1250 300 D 50 50 1 1 W 31 | X D0 13 950 850 300 L 50 50 1 1 B 32 | X A10 23 -900 -150 300 R 50 50 1 1 I 33 | X D1 14 950 750 300 L 50 50 1 1 B 34 | X ~OE 24 950 -650 300 L 50 50 1 1 I 35 | X D2 15 950 650 300 L 50 50 1 1 B 36 | X A11 25 -900 -250 300 R 50 50 1 1 I 37 | X GND 16 0 -1350 300 U 50 50 1 1 W 38 | X A9 26 -900 -50 300 R 50 50 1 1 I 39 | X D3 17 950 550 300 L 50 50 1 1 B 40 | X A8 27 -900 50 300 R 50 50 1 1 I 41 | X D4 18 950 450 300 L 50 50 1 1 B 42 | X A13 28 -900 -450 300 R 50 50 1 1 I 43 | X D5 19 950 350 300 L 50 50 1 1 B 44 | X A14 29 -900 -550 300 R 50 50 1 1 I 45 | ENDDRAW 46 | ENDDEF 47 | # 48 | #End Library 49 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/button.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_BUTTON_H 11 | #define MUIL_BUTTON_H 12 | 13 | #define MUIL_BUTTON_PROP_CHILD 0 14 | #define MUIL_BUTTON_PROP_ACTIVATED 1 15 | #define MUIL_BUTTON_PROP_BORDER 2 16 | #define MUIL_BUTTON_PROP_ACTIVE_BORDER 3 17 | 18 | struct MuilButtonProperties { 19 | MuilWidget *child; 20 | int activated; 21 | DrawRectSet *background; 22 | DrawLineSet *border; 23 | DrawLineSet *active_border; 24 | }; 25 | 26 | MuilWidget *muil_widget_create_button(MuilWidget *child); 27 | MuilWidget *muil_widget_create_button_text(DrawFont *font, const char *text); 28 | MuilWidget *muil_widget_create_button_image(); 29 | 30 | void *muil_widget_destroy_button(MuilWidget *widget); 31 | void *muil_widget_destroy_button_recursive(MuilWidget *widget); 32 | 33 | void muil_button_event_click(MuilWidget *widget, unsigned int type, MuilEvent *e); 34 | void muil_button_event_key(MuilWidget *widget, unsigned int type, MuilEvent *e); 35 | 36 | void muil_button_set_prop(MuilWidget *widget, int prop, MuilPropertyValue value); 37 | MuilPropertyValue muil_button_get_prop(MuilWidget *widget, int prop); 38 | void muil_button_resize(MuilWidget *widget, int x, int y, int w, int h); 39 | void muil_button_request_size(MuilWidget *widget, int *w, int *h); 40 | void muil_button_render(MuilWidget *widget); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/common/muil/include/muil/entry.h: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #ifndef MUIL_ENTRY_H 11 | #define MUIL_ENTRY_H 12 | 13 | #define MUIL_ENTRY_LENGTH 256 14 | 15 | #define MUIL_ENTRY_PROP_FONT 0 16 | #define MUIL_ENTRY_PROP_SURFACE 1 17 | #define MUIL_ENTRY_PROP_CURSOR_POS 2 18 | #define MUIL_ENTRY_PROP_OFFSET 3 19 | #define MUIL_ENTRY_PROP_BORDER 4 20 | #define MUIL_ENTRY_PROP_CURSOR 5 21 | #define MUIL_ENTRY_PROP_TEXT 6 22 | 23 | struct MuilEntryProperties { 24 | DrawFont *font; 25 | DrawTextSurface *surface; 26 | int cursor_pos; 27 | char *offset; 28 | DrawRectSet *background; 29 | DrawLineSet *border; 30 | DrawLineSet *cursor; 31 | char text[MUIL_ENTRY_LENGTH+1]; 32 | }; 33 | 34 | MuilWidget *muil_widget_create_entry(DrawFont *font); 35 | void *muil_widget_destroy_entry(MuilWidget *widget); 36 | 37 | void muil_entry_event_click(MuilWidget *widget, unsigned int type, MuilEvent *e); 38 | void muil_entry_event_key(MuilWidget *widget, unsigned int type, MuilEvent *e); 39 | 40 | void muil_entry_set_prop(MuilWidget *widget, int prop, MuilPropertyValue value); 41 | MuilPropertyValue muil_entry_get_prop(MuilWidget *widget, int prop); 42 | void muil_entry_resize(MuilWidget *widget, int x, int y, int w, int h); 43 | void muil_entry_request_size(MuilWidget *widget, int *w, int *h); 44 | void muil_entry_render(MuilWidget *widget); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/common/draw/src/bitmap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | DrawBitmap *draw_bitmap_new(int w, int h, DrawColor *data) { 8 | DrawBitmap *bitmap = NULL; 9 | 10 | if(!(bitmap = malloc(sizeof(DrawBitmap)))) 11 | goto fail; 12 | 13 | bitmap->data = data; 14 | bitmap->x = 0; 15 | bitmap->y = 0; 16 | bitmap->w = w; 17 | bitmap->h = h; 18 | bitmap->free_data = false; 19 | 20 | return bitmap; 21 | 22 | fail: 23 | return NULL; 24 | } 25 | 26 | 27 | DrawBitmap *draw_bitmap_new_raw(int w, int h) { 28 | DrawColor *data = NULL; 29 | DrawBitmap *bitmap = NULL; 30 | 31 | if(!(data = malloc(sizeof(DrawColor)*w*h))) 32 | goto fail; 33 | 34 | if(!(bitmap = draw_bitmap_new(w, h, data))) 35 | goto fail; 36 | 37 | bitmap->free_data = true; 38 | 39 | return bitmap; 40 | 41 | fail: 42 | free(data); 43 | draw_bitmap_free(bitmap); 44 | return NULL; 45 | } 46 | 47 | void draw_bitmap_free(DrawBitmap *bitmap) { 48 | if(!bitmap) 49 | return; 50 | 51 | if(bitmap->free_data) 52 | free(bitmap->data); 53 | 54 | free(bitmap); 55 | } 56 | 57 | void draw_bitmap_move(DrawBitmap *bitmap, int x, int y) { 58 | if(!bitmap) 59 | return; 60 | bitmap->x = x; 61 | bitmap->y = y; 62 | } 63 | 64 | void draw_bitmap_draw(DrawBitmap *bitmap) { 65 | int x, y; 66 | 67 | if(!bitmap) 68 | return; 69 | 70 | for (y = 0; y < bitmap->h; y++) { 71 | for (x = 0; x < bitmap->w; x++) { 72 | draw_framebuffer[(bitmap->y + y)*DRAW_SCREEN_W + bitmap->x + x] = bitmap->data[bitmap->w*y + x]; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/stage2/src/memtest.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "peripheral.h" 4 | #include "printf.h" 5 | 6 | #define BLOCK_SIZE 32768 7 | #define NO_BLOCKS 1024 8 | #define BLOCKS_TO_WRITE 1024 9 | #define PRINT_DOT_MASK 0x1F 10 | 11 | int memtest_run(bool use_cache) { 12 | int i, j, k; 13 | volatile uint16_t *ptr = (void *) SDRAM_BASE; 14 | 15 | if(use_cache) { 16 | __asm__ __volatile__ ( 17 | "cinva %%bc\n" 18 | "move.l #0x80008000, %%d0\n" 19 | "movec %%d0, %%cacr\n" 20 | : 21 | : 22 | : "d0" 23 | ); 24 | } else { 25 | __asm__ __volatile__ ( 26 | "move.l #0x00000000, %%d0\n" 27 | "movec %%d0, %%cacr\n" 28 | : 29 | : 30 | : "d0" 31 | ); 32 | } 33 | 34 | printf("\nTesting:\n"); 35 | 36 | for (i = 0; i < NO_BLOCKS; i = (i?(i<<1):1)) { 37 | for (j = 0; j < BLOCK_SIZE; j++) 38 | ptr[i * BLOCK_SIZE + j] = j; 39 | for (j = 0; j < BLOCKS_TO_WRITE; j++) { 40 | if (j == i) 41 | continue; 42 | for (k = 0; k < BLOCK_SIZE; k++) 43 | ptr[j * BLOCK_SIZE + k] = 0xFFFF; 44 | 45 | if((j & PRINT_DOT_MASK) == PRINT_DOT_MASK) 46 | printf("."); 47 | } 48 | 49 | if(use_cache) { 50 | __asm__ __volatile__ ("cpusha %dc\n"); 51 | __asm__ __volatile__ ("cinva %dc\n"); 52 | } 53 | for (j = 0; j < BLOCK_SIZE; j++) 54 | if (ptr[i * BLOCK_SIZE + j] != j) { 55 | printf("\nFAIL at 0x%X\n", (uint32_t) &ptr[i * BLOCK_SIZE + j]); 56 | printf("Expected 0x%X, got 0x%X\n", j, ptr[i * BLOCK_SIZE + j]); 57 | 58 | return 0; 59 | } 60 | printf("\n"); 61 | } 62 | 63 | printf("\nsuccess!\n"); 64 | return 1; 65 | } 66 | 67 | -------------------------------------------------------------------------------- /hdl/wor_logic.vhd: -------------------------------------------------------------------------------- 1 | library ieee; 2 | use ieee.std_logic_1164.all; 3 | 4 | package wor_logic is 5 | function resolve_wor(s : std_ulogic_vector) return std_ulogic; 6 | 7 | type stdlogic_table is array(std_ulogic, std_ulogic) of std_ulogic; 8 | constant resolution_table : stdlogic_table := ( 9 | -- --------------------------------------------------------- 10 | -- | U X 0 1 Z W L H - | | 11 | -- --------------------------------------------------------- 12 | ( 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U' ), -- | U | 13 | ( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ), -- | X | 14 | ( 'U', 'X', '0', '1', '0', '0', '0', '0', 'X' ), -- | 0 | 15 | ( 'U', 'X', '1', '1', '1', '1', '1', '1', 'X' ), -- | 1 | 16 | ( 'U', 'X', '0', '1', 'Z', 'W', 'L', 'H', 'X' ), -- | Z | 17 | ( 'U', 'X', '0', '1', 'W', 'W', 'W', 'W', 'X' ), -- | W | 18 | ( 'U', 'X', '0', '1', 'L', 'W', 'L', 'W', 'X' ), -- | L | 19 | ( 'U', 'X', '0', '1', 'H', 'W', 'W', 'H', 'X' ), -- | H | 20 | ( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ) -- | - | 21 | ); 22 | 23 | 24 | subtype wor_logic is resolve_wor std_ulogic; 25 | type wor_logic_vector is array ( natural range <>) of wor_logic; 26 | end package; 27 | 28 | package body wor_logic is 29 | function resolve_wor(s : std_ulogic_vector) return std_ulogic is 30 | variable result : std_ulogic := 'Z'; -- weakest state default 31 | begin 32 | if s'length = 1 then 33 | return s(s'low); 34 | else 35 | for i in s'range loop 36 | result := resolution_table(result, s(i)); 37 | end loop; 38 | end if; 39 | return result; 40 | end resolve_wor; 41 | end wor_logic; 42 | -------------------------------------------------------------------------------- /src/common/muil/src/messagebox.c: -------------------------------------------------------------------------------- 1 | /* MUIL - Muon UI Library 2 | * This file is part of MUIL. 3 | * Copyright 2012-2017 Axel Isaksson and Steven Arnow. 4 | * 5 | * The original code in Muon was licensed as GPL, the MUIL parts have been relicensed as MIT license. 6 | * See the COPYING file for details 7 | */ 8 | 9 | 10 | #include 11 | 12 | #define MESSAGE_BOX_WIDTH 256 13 | #define MESSAGE_BOX_HEIGHT 128 14 | 15 | void muil_messagebox(DrawFont *font, const char *text, const char *button_text) { 16 | static MuilPane *pane = NULL; 17 | static MuilWidget *label = NULL, *button = NULL, *vbox = NULL; 18 | if(label) 19 | label->destroy(label); 20 | if(button) 21 | button->destroy(button); 22 | if(vbox) 23 | vbox->destroy(vbox); 24 | if(pane) 25 | muil_pane_destroy(pane); 26 | 27 | if(!button_text) 28 | button_text = "Ok"; 29 | label =muil_widget_create_label(font, text); 30 | button =muil_widget_create_button_text(font, button_text); 31 | button->event_handler->add(button,muil_messagebox_button_click, MUIL_EVENT_TYPE_UI_WIDGET_ACTIVATE); 32 | vbox =muil_widget_create_vbox(); 33 | //muil_panelist_dialogue.pane = pane =muil_pane_create(muil_platform.screen_w / 2 - MESSAGE_BOX_WIDTH / 2,muil_platform.screen_h / 2 - MESSAGE_BOX_HEIGHT / 2, MESSAGE_BOX_WIDTH, MESSAGE_BOX_HEIGHT, vbox); 34 | muil_panelist_dialogue.pane = pane =muil_pane_create(100, 100, MESSAGE_BOX_WIDTH, MESSAGE_BOX_HEIGHT, vbox); 35 | muil_vbox_add_child(vbox, label, 1); 36 | muil_vbox_add_child(vbox, button, 0); 37 | } 38 | 39 | void muil_messagebox_button_click(MuilWidget *widget, unsigned int type, MuilEvent *e) { 40 | muil_panelist_dialogue.pane = NULL; 41 | } 42 | -------------------------------------------------------------------------------- /src/stage2/src/serial-transfer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "uart.h" 3 | #include "fat.h" 4 | #include "peripheral.h" 5 | #include "terminal.h" 6 | #include "printf.h" 7 | #include "input.h" 8 | #include "main.h" 9 | 10 | typedef struct Header Header; 11 | struct Header { 12 | uint32_t magic; 13 | uint32_t size; 14 | char fname[12]; 15 | }; 16 | 17 | void serial_transfer_recv() { 18 | Header header = {}; 19 | uint8_t *buf = (void *) SDRAM_BASE, *writebuf; 20 | char pathbuf[32] = "/0", *tmp; 21 | int fd, i, j; 22 | uint8_t c; 23 | 24 | uart_flush(); 25 | terminal_clear(); 26 | printf("Serial file transfer\n"); 27 | 28 | writebuf = buf; 29 | 30 | do { 31 | header.magic <<= 8; 32 | header.magic |= uart_recv(); 33 | } while(header.magic != 0x4649534BUL); 34 | 35 | for(i = 0; i < 4; i++) { 36 | header.size <<= 8; 37 | header.size |= uart_recv(); 38 | } 39 | 40 | for(i = 0; i < 11; i++) { 41 | header.fname[i] = uart_recv(); 42 | } 43 | 44 | for(i = 0; i < header.size; i++) { 45 | *writebuf++ = uart_recv(); 46 | } 47 | 48 | tmp = pathbuf + 1; 49 | for(i = 0; i < 8; i++) { 50 | if(header.fname[i] == ' ') 51 | break; 52 | *tmp++ = header.fname[i]; 53 | } 54 | *tmp++ = '.'; 55 | 56 | for(i = 8; i < 11; i++) { 57 | if(header.fname[i] == ' ') 58 | break; 59 | *tmp++ = header.fname[i]; 60 | } 61 | *tmp = 0; 62 | 63 | fat_delete_file(pathbuf); 64 | fat_create_file("/", pathbuf + 1, 0); 65 | fd = fat_open(pathbuf, O_RDWR); 66 | fat_set_fsize(pathbuf, header.size); 67 | 68 | for(j = 0; j < header.size; j += 512) { 69 | for(i = 0; i < 512; i++) { 70 | fat_buf[i] = *buf++; 71 | } 72 | fat_write_sect(fd); 73 | } 74 | fat_close(fd); 75 | printf("Done writing to file %s\n", pathbuf); 76 | input_poll(); 77 | } 78 | -------------------------------------------------------------------------------- /hw/motherboard/trollbook-rev2.pro.v4: -------------------------------------------------------------------------------- 1 | update=fre 12 jan 2018 09:36:12 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir=lib 31 | [eeschema/libraries] 32 | LibName1=trollbook-rev2-rescue 33 | LibName2=power 34 | LibName3=device 35 | LibName4=transistors 36 | LibName5=conn 37 | LibName6=linear 38 | LibName7=regul 39 | LibName8=74xx 40 | LibName9=cmos4000 41 | LibName10=adc-dac 42 | LibName11=memory 43 | LibName12=xilinx 44 | LibName13=microcontrollers 45 | LibName14=dsp 46 | LibName15=microchip 47 | LibName16=analog_switches 48 | LibName17=motorola 49 | LibName18=texas 50 | LibName19=intel 51 | LibName20=audio 52 | LibName21=interface 53 | LibName22=digital-audio 54 | LibName23=philips 55 | LibName24=display 56 | LibName25=cypress 57 | LibName26=siliconi 58 | LibName27=opto 59 | LibName28=atmel 60 | LibName29=contrib 61 | LibName30=valves 62 | LibName31=lib/MC68040FC33V 63 | LibName32=lib/EPF10K50VRC240 64 | LibName33=lib/39f040 65 | LibName34=lib/hy57v561620 66 | LibName35=lib/idt71v416 67 | LibName36=lib/tlc7524 68 | LibName37=lib/as7c34098 69 | LibName38=lib/s25fl204k0tmfi010 70 | LibName39=lib/epc2 71 | LibName40=lib/er-con40ht-1 72 | LibName41=lib/ada4851-4 73 | LibName42=lib/osc 74 | -------------------------------------------------------------------------------- /src/misc/hexload-new.s: -------------------------------------------------------------------------------- 1 | .text 2 | .align 2 3 | .globl loadhex 4 | 5 | .int 0x00100000 6 | .int 0x00000008 7 | 8 | nop 9 | 10 | loadhex: 11 | jsr get_byte 12 | cmp.b #58, %d7 13 | jne .skip 14 | /* Load byte count */ 15 | jsr decode_pair 16 | move.b %d7, %d4 17 | /* Load lower address */ 18 | jsr decode_word 19 | move.w %d7, %a0 20 | /* Load record type */ 21 | jsr decode_pair 22 | move.b %d7, %d0 23 | /* Load decide record type */ 24 | cmp.b #0, %d0 25 | jeq .read_data 26 | cmp.b #1, %d0 27 | jeq .done 28 | cmp.b #4, %d0 29 | jeq .upper_address 30 | cmp.b #5, %d0 31 | jeq .start_address 32 | jra .skip 33 | 34 | .read_data: 35 | cmp.b #0, %d0 36 | jeq .skip 37 | jsr decode_pair 38 | sub.b #-1, %d0 39 | move.b %d0, (%a0)+ 40 | jra .read_data 41 | 42 | .upper_address: 43 | jsr decode_word 44 | swap %d7 45 | move.l %a0, %d6 46 | move.w %d6, %d7 47 | move.l %d7, %a0 48 | jra .skip 49 | 50 | .start_address: 51 | jsr decode_word 52 | move %d7, %d3 53 | jsr decode_word 54 | swap %d3 55 | move.w %d7, %d3 56 | move.l %d3, %a1 57 | jra .skip 58 | 59 | .skip: 60 | jsr get_byte 61 | cmp.b #10, %d7 62 | jeq loadhex 63 | jra .skip 64 | .done: 65 | move.l %a1, -(%sp) 66 | rts 67 | 68 | 69 | decode_word: 70 | jsr decode_pair 71 | move %d5, %d7 72 | jsr decode_pair 73 | lsl.w #8, %d5 74 | or.w %d5, %d7 75 | rts 76 | 77 | decode_pair: 78 | jsr decode_byte 79 | move.l %d7, %d6 80 | jsr decode_byte 81 | lsl.b #4, %d6 82 | or.b %d6, %d7 83 | rts 84 | 85 | 86 | decode_byte: 87 | jsr get_byte 88 | cmp.b #57, %d7 89 | jle .decode_byte_lower 90 | add.b #-7, %d7 91 | .decode_byte_lower: 92 | add.b #-48, %d7 93 | rts 94 | 95 | 96 | get_byte: 97 | move.l 1048580, %d7 98 | btst #1, %d7 99 | jeq get_byte 100 | move.l 1048576, %d7 101 | rts 102 | 103 | nop 104 | -------------------------------------------------------------------------------- /src/stage2/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/common/draw/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/common/muil/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/common/util/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/demos/tsko/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/common/file-io/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/common/sound/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/common/terminal/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/common/ungzip/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/demos/modplay/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/demos/timer_test/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/demos/trololo/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | -------------------------------------------------------------------------------- /src/common/lz4inflate/src/Makefile: -------------------------------------------------------------------------------- 1 | # Project: trollbook-bios 2 | TOPDIR = $(shell DIR=.; while [ ! "`readlink -f \"$${DIR}\"`" = "/" -a ! -f "$${DIR}/config.mk" ]; do DIR="../$${DIR}"; done; echo "$${DIR}") 3 | ifeq ($(shell readlink -f "$(TOPDIR)"),/) 4 | $(error Could not find the project top directory with config.mk) 5 | endif 6 | include $(TOPDIR)/config.mk 7 | 8 | ASMFILES = $(wildcard *.S) 9 | SRCFILES = $(wildcard *.c) 10 | OBJFILES = $(SRCFILES:.c=.c.o) 11 | OBJFILES += $(ASMFILES:.S=.S.o) 12 | 13 | OUTFILE = out.a 14 | 15 | # Sub directories to build 16 | SUBDIRS = $(foreach dir,$(wildcard */Makefile),$(dir $(dir))) 17 | 18 | LIBS = $(addsuffix /$(OUTFILE),$(SUBDIRS)) 19 | 20 | DEPDIR = .deps 21 | df = $(DEPDIR)/$(*F) 22 | 23 | .PHONY: all clean 24 | .PHONY: $(SUBDIRS) 25 | 26 | all: $(OUTFILE) 27 | @echo " [DONE] $(CURRENTPATH)" 28 | 29 | clean: $(SUBDIRS) 30 | @echo " [ RM ] $(OBJFILES) $(OUTFILE)" 31 | @$(RM) $(OBJFILES) $(OUTFILE) 32 | @$(RM) -R $(DEPDIR) 33 | 34 | $(OUTFILE): $(OBJFILES) $(SUBDIRS) 35 | @echo " [ AR ] $(CURRENTPATH)$(OUTFILE)" 36 | @$(RM) $(OUTFILE) 37 | @$(AR) -cmT $(OUTFILE) $(OBJFILES) $(LIBS) 38 | 39 | $(SUBDIRS): 40 | @echo " [ CD ] $(CURRENTPATH)$@" 41 | @+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@" $(MAKECMDGOALS) 42 | 43 | $(DEPDIR): 44 | @mkdir -p $@ 45 | 46 | %.c.o: %.c | $(DEPDIR) 47 | @echo " [ CC ] $(CURRENTPATH)$<" 48 | @$(CC) $(CFLAGS) -c -MD -o $@ $< 49 | @cp $*.c.d $(df).c.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.c.d >> $(df).c.P; $(RM) $*.c.d 50 | 51 | %.S.o: %.S | $(DEPDIR) 52 | @echo " [ AS ] $(CURRENTPATH)$<" 53 | @$(CC) $(CFLAGS) $(ASFLAGS) -c -MD -o $@ $< 54 | @cp $*.S.d $(df).S.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.S.d >> $(df).S.P; $(RM) $*.S.d 55 | 56 | -include $(SRCFILES:%.c=$(DEPDIR)/%.c.P) 57 | -include $(ASMFILES:%.S=$(DEPDIR)/%.S.P) 58 | --------------------------------------------------------------------------------