From f20b4d1be79db63b77f03d3455f7d9c6a8e97e10 Mon Sep 17 00:00:00 2001 From: giomba Date: Sat, 4 Mar 2023 23:09:40 +0100 Subject: [PATCH] First commit. --- .gitignore | 2 ++ Makefile | 28 ++++++++++++++++++++++++++++ README.md | 18 ++++++++++++++++++ main.asm | 38 ++++++++++++++++++++++++++++++++++++++ makepacket.py | 14 ++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100644 main.asm create mode 100644 makepacket.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dc84959 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/ + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9fd556b --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +.POSIX: + +ECHO := @echo +QUIET := @ + +OUTDIR := build +SERIALPORT := /dev/ttyUSB0 + +$(OUTDIR)/main.bin: main.asm + $(ECHO) ' ASM' + $(QUIET) mkdir -p $(OUTDIR) + $(QUIET) zcc +z80 -subtype=none -o $(OUTDIR)/main.bin main.asm + +.PHONY: send +send: $(OUTDIR)/main.bin.pkt + $(ECHO) ' SEND' + $(QUIET) stty -F $(SERIALPORT) 9600 -crtscts + $(QUIET) cat "$<" > $(SERIALPORT) + +$(OUTDIR)/%.bin.pkt: $(OUTDIR)/%.bin + $(ECHO) ' PKT' + $(QUIET) python3 makepacket.py "$<" + +.PHONY: clean +clean: + $(ECHO) ' RM' + $(QUIET) rm -rf $(OUTDIR) + diff --git a/README.md b/README.md new file mode 100644 index 0000000..66b9f29 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# CEDA Utils + +You've your Sanco retrocomputer, but you have no peripherals and no disks, so you have no idea how to interact with it. +Here you can find some utilities to jump start your computer from scratch! + +## Bill of materials + +- RS232 DB-25 cable + - depending on your supplies, if you are working in the 3rd millenium, maybe you also need some adapters (eg. USB/RS-232), "ancient" cables (eg. old fashioned DB-9/DB-25 serial cable), and maybe a DB gender changer (no pun intended) +- EEPROM programmer for 28C32 (or larger) + - you can even build one with an Arduino +- 28C32 blank EEPROM +- common hardware tools (eg. screwdrivers) + +:warning: Mess with electronics only if you know what you are doing. Beware: you may harm your computer, or even yourself! Everything you do is at your own risk. + +## How to +- to be written diff --git a/main.asm b/main.asm new file mode 100644 index 0000000..f183ab2 --- /dev/null +++ b/main.asm @@ -0,0 +1,38 @@ + org 0x1000 + +prhex = $c174 +putchar = $c45e + +PUBLIC _main +_main: + ld hl,$0000 + +main_loop: + ld a,$0e + out ($a0),a + ld a,h + out ($a1),a + + ld a,$0f + out ($a0),a + ld a,l + out ($a1),a + + call delay + inc hl + jp main_loop + + jp ASMPC + + +delay: + push de + ld de,$0000 +delay_loop: + dec de + ld a,d + or e + jr nz,delay_loop + + pop de + ret \ No newline at end of file diff --git a/makepacket.py b/makepacket.py new file mode 100644 index 0000000..7529cf0 --- /dev/null +++ b/makepacket.py @@ -0,0 +1,14 @@ +#!/usr/bin/python3 + +import sys +import struct + +filename = sys.argv[1] + +ofile = open(filename + ".pkt", 'wb') + +ifile = open(filename, 'rb') +content = ifile.read() + +ofile.write(struct.pack("