From 2c07ced789b02fc7e2633ccd276ece53aef824ca Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Fri, 16 Feb 2024 18:11:58 +0000 Subject: [PATCH] Programs: Added a program that will draw a spinning cube on the vector display but currently only does the perspective calculations --- .gitignore | 2 +- Makefile | 6 +- programs/3d_renderer.asm | 231 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 236 insertions(+), 3 deletions(-) create mode 100644 programs/3d_renderer.asm diff --git a/.gitignore b/.gitignore index e20c756..ea5b1d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.o first -test.rom +*.rom make.deps diff --git a/Makefile b/Makefile index c381255..d3af674 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ QUIET=1 all:first OBJECT_FILES=gui.o main.o simdata.o assembly.o cpu.o +MAIN_ROM=programs/3d_renderer.rom +ROMS=test.rom ${MAIN_ROM} make.deps: $(subst .o,.c,${OBJECT_FILES}) $(wildcard *.h) @$(CC) -MM $(subst .o,.c,${OBJECT_FILES}) > make.deps @@ -20,7 +22,7 @@ else Q = endif -all:test.rom +all:${MAIN_ROM} first: ${OBJECT_FILES} ${QUIET_LINK} @@ -37,4 +39,4 @@ first: ${OBJECT_FILES} .PHONY: clean clean: ${QUIET_CLEAN} - ${Q} rm -f ${OBJECT_FILES} first + ${Q} rm -f ${OBJECT_FILES} first ${ROMS} diff --git a/programs/3d_renderer.asm b/programs/3d_renderer.asm new file mode 100644 index 0000000..6854424 --- /dev/null +++ b/programs/3d_renderer.asm @@ -0,0 +1,231 @@ +MOV $0xFF0000,%SP +#Set up vector mode +MOV $0xFFFC,%R4l +MOV $0x00FF,%R4h +MOV $0xFFFF,%R1l +MOV $0xFFFF,%R1h +MOV %R1,(%R4) +CALL $RENDER + +:RENDER +MOV $>DATA_START,%R0l +MOV $