First commit.

This commit is contained in:
giomba 2023-10-08 21:38:15 +02:00
commit 2645501186
8 changed files with 84 additions and 0 deletions

6
.clang-format Normal file
View File

@ -0,0 +1,6 @@
# clang-format 15.0.7
IndentWidth: 4
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: Empty
AlignConsecutiveMacros: true

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
build/
*.o

32
Makefile Normal file
View File

@ -0,0 +1,32 @@
SRC = \
src/ceda_print.c \
src/entrypoint.c \
src/main.c \
\
OBJ = $(patsubst %, %.o, $(basename $(SRC)))
ECHO := @echo
QUIET := @
OUTDIR := build
$(OUTDIR)/main.prg: $(OUTDIR)/main.rom
dd if=$< of=$@ bs=1 seek=2
$(OUTDIR)/main.rom: $(OBJ) | $(OUTDIR)
zcc +z80 -create-app --no-crt -m -o $@ $?
%.o: %.c
zcc +z80 -c -o $@ $<
%.o: %.asm
zcc +z80 -c -o $@ $<
$(OUTDIR):
mkdir -p $@
.PHONY: clean
clean:
$(RM) $(OBJ)
$(RM) -r $(OUTDIR)

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# ceda-demo
Demo for the Sanco 800x.
The purpose of this demo is mainly to thinker with the hardware of the mentioned computer, since we are reverse-engineering it, and even writing an emulator.
This repository is part of the [CEDA project](https://github.com/GLGPrograms/ceda-home) by [Retrofficina GLG Programs](https://retrofficina.glgprograms.it/).

11
src/ceda_print.c Normal file
View File

@ -0,0 +1,11 @@
#include "ceda_print.h"
void ceda_print(const char *s) {
static char *const VIDEO_MEMORY = (char *const)(0xd000);
char *p = VIDEO_MEMORY;
while (*s != '\0') {
*p++ = *s++;
}
}

7
src/ceda_print.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef CEDA_PRINT_H
#define CEDA_PRINT_H
void ceda_print(const char* s);
#endif // CEDA_PRINT_H

9
src/entrypoint.asm Normal file
View File

@ -0,0 +1,9 @@
EXTERN _main
entrypoint:
ld sp,0xc000
call _main
jp ASMPC

8
src/main.c Normal file
View File

@ -0,0 +1,8 @@
#include "ceda_print.h"
int main(void) {
ceda_print("Hello world!");
return 0;
}