From be35e0319ac0e5e86c22c899b0037f77e408bc95 Mon Sep 17 00:00:00 2001 From: s3lph Date: Tue, 8 Feb 2022 12:37:59 +0100 Subject: [PATCH] Add gitlab-ci --- .gitlab-ci.yml | 12 ++++++++++++ Makefile | 9 ++++++--- src/emu6502.c | 2 ++ 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..62f8770 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,12 @@ +--- + +image: debian:bullseye + +build: + script: + - apt update; apt install -y gcc make xa65 + - make test + artifacts: + paths: + - "out/memtest*k-f000.901465.bin" + diff --git a/Makefile b/Makefile index f4a7e07..509b228 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -.PHONY: all memtest6502 emu5602 +.PHONY: all memtest6502 emu6502 -all: memtest6502 emu5602 +all: memtest6502 emu6502 clean: rm -rf tmp out @@ -20,7 +20,10 @@ memtest6502: xa '-D_MEMEND=$$1000' -M -A F000 -O ASCII -c -C -v -l tmp/memtest4k-f000-ascii.map -o tmp/memtest4k-f000-ascii.o65 src/memtest6502.asm dd if=tmp/memtest4k-f000-ascii.o65 bs=1 skip=2 of=out/memtest4k-f000-ascii.emu6502.bin -emu5602: memtest6502 +emu6502: memtest6502 # _END is set to the address of the last instruction s.t. the emulator knows when to terminate gcc -D_END=$$(cat tmp/memtest4k-f000-ascii.map | grep ^done, | cut -d, -f2 | tr -d ' ,') -o out/emu6502 src/emu6502.c src/fake6502.c +test: memtest6502 + gcc -DNOLIMIT -D_END=$$(cat tmp/memtest4k-f000-ascii.map | grep ^done, | cut -d, -f2 | tr -d ' ,') -o out/emu6502 src/emu6502.c src/fake6502.c + out/emu6502 | tail -30 diff --git a/src/emu6502.c b/src/emu6502.c index 0cc2e27..5719bb2 100644 --- a/src/emu6502.c +++ b/src/emu6502.c @@ -84,7 +84,9 @@ int main() { reset6502(); signal(SIGINT, intv); while (1) { +#ifndef NOLIMIT usleep(1); +#endif step6502(); printf("pass: %02x, address: %02x%02x\n", ram[4], ram[1], ram[2]); printf("┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n");