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 $