From 73e4be2acc9f8a3fad60b5871907a1beaa9cae24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kujawa?= Date: Wed, 18 Jan 2017 23:47:55 +0100 Subject: [PATCH] Add support for building test case ROMs with vasm. While here add first such ROM, for nop instruction test. --- test/Makefile | 18 +++++++++++++----- test/test_emulation_nop.s | 3 +++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 test/test_emulation_nop.s diff --git a/test/Makefile b/test/Makefile index bf21e3e..9041994 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,15 +1,22 @@ CFLAGS=-Wall -I../src -g LDFLAGS=-latf-c RK6502LIB=../src/librk65c02.a +VASM=vasm6502_std +VASMFLAGS=-Fbin -c02 + TESTS=test_bus test_emulation +TESTROMS=test_emulation_nop.rom -all : $(TESTS) +all : $(TESTS) $(TESTROMS) -test_bus : test_bus.o - $(CC) -o test_bus $(LDFLAGS) $< $(RK6502LIB) +test_bus : test_bus.o $(RK6502LIB) + $(CC) -o $@ $(LDFLAGS) $< $(RK6502LIB) -test_emulation : test_emulation.o - $(CC) -o test_emulation $(LDFLAGS) $< $(RK6502LIB) +test_emulation : test_emulation.o $(RK6502LIB) + $(CC) -o $@ $(LDFLAGS) $< $(RK6502LIB) + +%.rom : %.s + $(VASM) $(VASMFLAGS) -o $@ $< %.o : %.c $(CC) $(CFLAGS) -c $< @@ -17,4 +24,5 @@ test_emulation : test_emulation.o clean : rm -f *.o rm -f $(TESTS) + rm -f $(TESTROMS) diff --git a/test/test_emulation_nop.s b/test/test_emulation_nop.s new file mode 100644 index 0000000..4fbd98a --- /dev/null +++ b/test/test_emulation_nop.s @@ -0,0 +1,3 @@ +start: nop + stp +