From f04c1eb5508d829068db590ebdf6c8f3bf5fd612 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 26 Aug 2020 15:17:30 -0700 Subject: [PATCH] Fixed build issue with plan9 --- build.sh | 8 +++++++- lin6.c | 14 +++++++------- source.asm | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 8ab7861..a9dc5d2 100755 --- a/build.sh +++ b/build.sh @@ -4,13 +4,19 @@ rm ./lin6 clang-format -i lin6.c +# Gnu/Linux cc -std=c89 -DDEBUG -Wall -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined lin6.c -o lin6 +# Rpi # tcc -Wall lin6.c -o lin6 +# Plan9 +# pcc lin6.c -o lin6 + ./lin6 ./lin6 -? ./lin6 -v ./lin6 source.asm ./lin6 -i source.asm -./lin6 -i -d source.asm \ No newline at end of file +./lin6 -i -d source.asm + diff --git a/lin6.c b/lin6.c index b89c616..93828b4 100644 --- a/lin6.c +++ b/lin6.c @@ -1,5 +1,5 @@ /* Lin6 - Version 1.1 + Version 1.2 https://wiki.xxiivv.com/lin6 */ @@ -24,14 +24,15 @@ */ #include -#include #include #include #include -#define VERSION "1.1" +#define VERSION "1.2" #define BUFLEN 512 +typedef enum { false, true } bool; + char *OPCODES[] = {"ADC", "AND", "ASL", "BCC", "BCS", "BEQ", "BIT", "BMI", "BNE", "BPL", "BRK", "BVC", "BVS", "CLC", "CLD", "CLI", "CLV", "CMP", "CPX", "CPY", "DEC", "DEX", "DEY", "EOR", @@ -285,7 +286,6 @@ void lint(char *filepath, char *output, bool do_debug) { strcat(output, "\n"); } if (has_comment(line)) { - fillstr(key, 30, ' '); strcat(output, key); strcat(output, " "); strcat(output, comment); @@ -400,9 +400,9 @@ void lint(char *filepath, char *output, bool do_debug) { fclose(fr); } -void show_version() { puts("Lin6 " VERSION); } +void show_version(void) { puts("Lin6 " VERSION); } -void show_help() { +void show_help(void) { show_version(); puts(""); puts("A tool to format 6502 assembly code.\n"); @@ -447,4 +447,4 @@ int main(int argc, char *argv[]) { } } return 0; -} +} \ No newline at end of file diff --git a/source.asm b/source.asm index c3fac7d..0aef5be 100644 --- a/source.asm +++ b/source.asm @@ -22,7 +22,7 @@ NMI: ;; Routines -CheckCollision: ; Routine comment +CheckCollision: ; Routine comment LDA pos_y CMP #$88 ; Opcode comment BCC @done -- 2.45.2