From ba93ab07bc5652be9b0692180ab0ae616e96c74c Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 09:19:37 +0100 Subject: [PATCH 01/12] Do not compile petscii test for unsupported platforms. Only C64 is supported. --- targettest/cbm/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/targettest/cbm/Makefile b/targettest/cbm/Makefile index 298f80d62..147df2c1c 100644 --- a/targettest/cbm/Makefile +++ b/targettest/cbm/Makefile @@ -32,8 +32,12 @@ endif all: petscii.prg cbmdir-test.prg +ifeq ($(SYS),c64) petscii.prg: petscii.c $(CL) -t $(SYS) -O -o petscii.prg petscii.c +else +petscii.prg: +endif cbmdir-test.prg: cbmdir-test.c $(CL) -t $(SYS) -Oris -o $@ $< From 58dd28f0536b269c7fe3d03200985e8d05d78c3d Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 09:40:32 +0100 Subject: [PATCH 02/12] Make VICE monitor command lists for Commodore platforms. --- targettest/Makefile | 40 +++++++++++++++++++++++++++++++++++++++- targettest/cbm/Makefile | 2 +- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/targettest/Makefile b/targettest/Makefile index f3694335c..16f25fd3f 100644 --- a/targettest/Makefile +++ b/targettest/Makefile @@ -122,6 +122,44 @@ DISK_atarixl = testcode.atr .PRECIOUS: %.o +LDFLAGS= +ifeq ($(SYS),c64) + LDFLAGS+=-Ln $@.lst +endif +ifeq ($(SYS),c128) + LDFLAGS+=-Ln $@.lst +endif +ifeq ($(SYS),c16) + LDFLAGS+=-Ln $@.lst +endif +ifeq ($(SYS),cbm510) + LDFLAGS+=-Ln $@.lst +endif +ifeq ($(SYS),cbm510) + LDFLAGS+=-Ln $@.lst +endif +ifeq ($(SYS),cx16) + LDFLAGS+=-Ln $@.lst +endif +ifeq ($(SYS),geos-cbm) + LDFLAGS+=-Ln $@.lst +endif +ifeq ($(SYS),lunix) + LDFLAGS+=-Ln $@.lst +endif +ifeq ($(SYS),pet) + LDFLAGS+=-Ln $@.lst +endif +ifeq ($(SYS),pet-overlay) + LDFLAGS+=-Ln $@.lst +endif +ifeq ($(SYS),plus4) + LDFLAGS+=-Ln $@.lst +endif +ifeq ($(SYS),vic20) + LDFLAGS+=-Ln $@.lst +endif + .o: ifeq ($(SYS),vic20) $(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -C vic20-32k.cfg -m $@.map $^ $(SYS).lib @@ -386,7 +424,7 @@ testcode.atr: testcode # Clean-up rules mostlyclean: - @$(DEL) *.lbl *.map *.o 2>$(NULLDEV) + @$(DEL) *.lbl *.map *.lst *.o 2>$(NULLDEV) # we cant use .s since we have asm files in the directory that we want to keep @$(DEL) ${patsubst %.c,%.s,$(wildcard *.c)} 2>$(NULLDEV) diff --git a/targettest/cbm/Makefile b/targettest/cbm/Makefile index 147df2c1c..73b51fc76 100644 --- a/targettest/cbm/Makefile +++ b/targettest/cbm/Makefile @@ -43,4 +43,4 @@ cbmdir-test.prg: cbmdir-test.c $(CL) -t $(SYS) -Oris -o $@ $< clean: - @$(DEL) petscii.prg cbmdir-test.prg 2>$(NULLDEV) + @$(DEL) *.lst petscii.prg cbmdir-test.prg 2>$(NULLDEV) From bdd18d958b47332fbad42d0934b91d5e52639d79 Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 09:45:15 +0100 Subject: [PATCH 03/12] cbmdir-test for VICs needs memory expansion. --- targettest/cbm/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/targettest/cbm/Makefile b/targettest/cbm/Makefile index 73b51fc76..3c0678c32 100644 --- a/targettest/cbm/Makefile +++ b/targettest/cbm/Makefile @@ -40,7 +40,11 @@ petscii.prg: endif cbmdir-test.prg: cbmdir-test.c +ifeq ($(SYS),vic20) + $(CL) -C vic20-32k.cfg -Oris -o $@ $< +else $(CL) -t $(SYS) -Oris -o $@ $< +endif clean: @$(DEL) *.lst petscii.prg cbmdir-test.prg 2>$(NULLDEV) From 65564a158c5347f3e949139833706344a7a35b0b Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 09:57:18 +0100 Subject: [PATCH 04/12] Remove most compiler warnings. --- targettest/gamate/ctest.c | 3 +++ targettest/heaptest.c | 6 +++--- targettest/strdup-test.c | 2 +- targettest/tinyshell.c | 14 +++++++------- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/targettest/gamate/ctest.c b/targettest/gamate/ctest.c index bff3f5986..b2c3740c5 100644 --- a/targettest/gamate/ctest.c +++ b/targettest/gamate/ctest.c @@ -9,6 +9,9 @@ unsigned short n; int main(int argc, char *argv[]) { + (void) argc; // Suppress warnings. + (void) argv; + clrscr(); gotoxy(0,0);cputs("Gamate C-Test"); diff --git a/targettest/heaptest.c b/targettest/heaptest.c index 560694bee..e3a21eaa6 100644 --- a/targettest/heaptest.c +++ b/targettest/heaptest.c @@ -6,7 +6,7 @@ -static unsigned char* V[256]; +static char* V[256]; @@ -17,7 +17,7 @@ static char* Alloc (void) unsigned char Size = (((unsigned char)rand()) & 0x7F) + 1; /* Allocate memory */ - unsigned char* P = malloc (Size); + char* P = malloc (Size); /* Set the string to a defined value. We use the size, since this will ** also allow us to retrieve it later. @@ -33,7 +33,7 @@ static char* Alloc (void) -static void Free (unsigned char* P) +static void Free (char* P) /* Check a memory block and free it */ { unsigned char I; diff --git a/targettest/strdup-test.c b/targettest/strdup-test.c index 2fcc9816f..8e7ae87d8 100644 --- a/targettest/strdup-test.c +++ b/targettest/strdup-test.c @@ -5,7 +5,7 @@ #include <_heap.h> -static unsigned char* V[256]; +static char* V[256]; static void ShowInfo (void) /* Show heap info */ diff --git a/targettest/tinyshell.c b/targettest/tinyshell.c index c83bd14e8..71e9b56e3 100644 --- a/targettest/tinyshell.c +++ b/targettest/tinyshell.c @@ -60,13 +60,13 @@ extern unsigned int getsp(void); /* comes from getsp.s */ static unsigned char verbose; static unsigned char terminate; static unsigned char cmd; -static unsigned char *cmd_asc, *arg1, *arg2, *arg3, *args; /* 'args': everything after command */ -static unsigned char keyb_buf[KEYB_BUFSZ + 1]; -static unsigned char keyb_buf2[KEYB_BUFSZ + 1]; +static char *cmd_asc, *arg1, *arg2, *arg3, *args; /* 'args': everything after command */ +static char keyb_buf[KEYB_BUFSZ + 1]; +static char keyb_buf2[KEYB_BUFSZ + 1]; static size_t cpbuf_sz = 4096; struct cmd_table { - unsigned char *name; + char *name; unsigned char code; } cmd_table[] = { { "help", CMD_HELP }, @@ -196,7 +196,7 @@ static void cmd_help(void) static void cmd_ls(void) { DIR *dir; - unsigned char *arg; + char *arg; struct dirent *dirent; #ifdef __ATARI__ char need_free = 0; @@ -356,7 +356,7 @@ static void cmd_rename(void) static void cmd_exec(void) { - unsigned char *progname, *arguments; + char *progname, *arguments; progname = strtok(args, " \t\n"); if (! progname) { @@ -373,7 +373,7 @@ static void cmd_exec(void) static void cmd_copy(void) { int srcfd = -1, dstfd = -1; - unsigned char *buf; + char *buf; int readsz, writesz; if (!arg2 || arg3) { From de158c08470f40098fff9de4230c56751b536e88 Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 20:07:34 +0100 Subject: [PATCH 05/12] Use suffix '.lbl' instead of '.lst'. --- targettest/Makefile | 26 +++++++++++++------------- targettest/cbm/Makefile | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/targettest/Makefile b/targettest/Makefile index 16f25fd3f..6aabe06a3 100644 --- a/targettest/Makefile +++ b/targettest/Makefile @@ -124,40 +124,40 @@ DISK_atarixl = testcode.atr LDFLAGS= ifeq ($(SYS),c64) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),c128) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),c16) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),cbm510) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),cbm510) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),cx16) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),geos-cbm) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),lunix) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),pet) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),pet-overlay) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),plus4) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),vic20) - LDFLAGS+=-Ln $@.lst + LDFLAGS+=-Ln $@.lbl endif .o: @@ -424,7 +424,7 @@ testcode.atr: testcode # Clean-up rules mostlyclean: - @$(DEL) *.lbl *.map *.lst *.o 2>$(NULLDEV) + @$(DEL) *.lbl *.map *.lbl *.o 2>$(NULLDEV) # we cant use .s since we have asm files in the directory that we want to keep @$(DEL) ${patsubst %.c,%.s,$(wildcard *.c)} 2>$(NULLDEV) diff --git a/targettest/cbm/Makefile b/targettest/cbm/Makefile index 3c0678c32..cbff73273 100644 --- a/targettest/cbm/Makefile +++ b/targettest/cbm/Makefile @@ -47,4 +47,4 @@ else endif clean: - @$(DEL) *.lst petscii.prg cbmdir-test.prg 2>$(NULLDEV) + @$(DEL) *.lbl petscii.prg cbmdir-test.prg 2>$(NULLDEV) From 34dd29556fb72586829de1456f055366bad9083e Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 20:09:18 +0100 Subject: [PATCH 06/12] Use -t option alongside -C. --- targettest/Makefile | 2 +- targettest/cbm/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/targettest/Makefile b/targettest/Makefile index 6aabe06a3..1340fb5eb 100644 --- a/targettest/Makefile +++ b/targettest/Makefile @@ -162,7 +162,7 @@ endif .o: ifeq ($(SYS),vic20) - $(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -C vic20-32k.cfg -m $@.map $^ $(SYS).lib + $(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -t $(SYS) -C vic20-32k.cfg -m $@.map $^ $(SYS).lib else $(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -t $(SYS) -m $@.map $^ $(SYS).lib endif diff --git a/targettest/cbm/Makefile b/targettest/cbm/Makefile index cbff73273..a7646c2d9 100644 --- a/targettest/cbm/Makefile +++ b/targettest/cbm/Makefile @@ -41,7 +41,7 @@ endif cbmdir-test.prg: cbmdir-test.c ifeq ($(SYS),vic20) - $(CL) -C vic20-32k.cfg -Oris -o $@ $< + $(CL) -t $(SYS) -C vic20-32k.cfg -Oris -o $@ $< else $(CL) -t $(SYS) -Oris -o $@ $< endif From 412a30987ad24447f6f3f37d0307c505eb65a5db Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 20:10:53 +0100 Subject: [PATCH 07/12] Remove -t option for linker only. --- targettest/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targettest/Makefile b/targettest/Makefile index 1340fb5eb..6aabe06a3 100644 --- a/targettest/Makefile +++ b/targettest/Makefile @@ -162,7 +162,7 @@ endif .o: ifeq ($(SYS),vic20) - $(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -t $(SYS) -C vic20-32k.cfg -m $@.map $^ $(SYS).lib + $(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -C vic20-32k.cfg -m $@.map $^ $(SYS).lib else $(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -t $(SYS) -m $@.map $^ $(SYS).lib endif From f4702cbc40d7111118e2d182141bafe145669577 Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 20:11:22 +0100 Subject: [PATCH 08/12] Make label file for c610 platform. --- targettest/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targettest/Makefile b/targettest/Makefile index 6aabe06a3..f9afff64f 100644 --- a/targettest/Makefile +++ b/targettest/Makefile @@ -135,7 +135,7 @@ endif ifeq ($(SYS),cbm510) LDFLAGS+=-Ln $@.lbl endif -ifeq ($(SYS),cbm510) +ifeq ($(SYS),cbm610) LDFLAGS+=-Ln $@.lbl endif ifeq ($(SYS),cx16) From 0707cdbe2c75cf36aa7f5098870beddefaa24dda Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 20:12:45 +0100 Subject: [PATCH 09/12] Remove command line arguments and return value from main(). --- targettest/gamate/ctest.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/targettest/gamate/ctest.c b/targettest/gamate/ctest.c index b2c3740c5..6b2de2354 100644 --- a/targettest/gamate/ctest.c +++ b/targettest/gamate/ctest.c @@ -7,11 +7,8 @@ unsigned char y = 0; unsigned char x = 0; unsigned short n; -int main(int argc, char *argv[]) +void main(void) { - (void) argc; // Suppress warnings. - (void) argv; - clrscr(); gotoxy(0,0);cputs("Gamate C-Test"); From 3bd72b96599c37d2acf6a1813bd17133caa884b2 Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 20:15:09 +0100 Subject: [PATCH 10/12] main(): Re-introduce return value. Compiler rejects 'void'. --- targettest/gamate/ctest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targettest/gamate/ctest.c b/targettest/gamate/ctest.c index 6b2de2354..c3ee819bc 100644 --- a/targettest/gamate/ctest.c +++ b/targettest/gamate/ctest.c @@ -7,7 +7,7 @@ unsigned char y = 0; unsigned char x = 0; unsigned short n; -void main(void) +int main(void) { clrscr(); gotoxy(0,0);cputs("Gamate C-Test"); From 05b8af07aa38531a193d10b77a6be59e66400fdc Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 21:21:01 +0100 Subject: [PATCH 11/12] main(): No return value. --- targettest/gamate/ctest.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/targettest/gamate/ctest.c b/targettest/gamate/ctest.c index c3ee819bc..9acbe94cd 100644 --- a/targettest/gamate/ctest.c +++ b/targettest/gamate/ctest.c @@ -7,7 +7,7 @@ unsigned char y = 0; unsigned char x = 0; unsigned short n; -int main(void) +void main(void) { clrscr(); gotoxy(0,0);cputs("Gamate C-Test"); @@ -47,6 +47,4 @@ int main(void) (*((unsigned char*)LCD_YPOS)) = y; } - - return 0; } From 683739d6fc308da3a11d3359f5d7ecbc569e3c20 Mon Sep 17 00:00:00 2001 From: Sven Michael Klose Date: Sat, 25 Dec 2021 21:25:52 +0100 Subject: [PATCH 12/12] mostlyclean: Clean up. --- targettest/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targettest/Makefile b/targettest/Makefile index f9afff64f..7d752480b 100644 --- a/targettest/Makefile +++ b/targettest/Makefile @@ -424,7 +424,7 @@ testcode.atr: testcode # Clean-up rules mostlyclean: - @$(DEL) *.lbl *.map *.lbl *.o 2>$(NULLDEV) + @$(DEL) *.lbl *.map *.o 2>$(NULLDEV) # we cant use .s since we have asm files in the directory that we want to keep @$(DEL) ${patsubst %.c,%.s,$(wildcard *.c)} 2>$(NULLDEV)