From 91574f690c9cd543ccc8704a56aea512bb86b947 Mon Sep 17 00:00:00 2001 From: Bjorn Einar Bjarntes Date: Sat, 18 Dec 2021 14:16:34 +0100 Subject: [PATCH] get rid of it --- .gitignore | 2 + .vimspector.json | 26 --- .vscode/extensions.json | 8 +- .vscode/launch.json | 134 -------------- .vscode/tasks.json | 47 +++-- Makefile | 345 ------------------------------------ Makefile.options | 1 - mk.bat | 13 -- mk.sh | 8 - readme.md | 3 +- src/{program.c64 => main.c} | 0 11 files changed, 30 insertions(+), 557 deletions(-) delete mode 100644 .vimspector.json delete mode 100644 .vscode/launch.json delete mode 100644 Makefile delete mode 100644 Makefile.options delete mode 100644 mk.bat delete mode 100755 mk.sh rename src/{program.c64 => main.c} (100%) diff --git a/.gitignore b/.gitignore index b23179b..bd4a4be 100644 --- a/.gitignore +++ b/.gitignore @@ -8,9 +8,11 @@ disk/ *.orig *.rej +*.o *.pet *.prg *.d81 +*.c64 *.d64 *.lbl *.dbg diff --git a/.vimspector.json b/.vimspector.json deleted file mode 100644 index cd3f0ed..0000000 --- a/.vimspector.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "configurations": { - "CC65 VICE Launch": { - "adapter": "cust_cc65-vice", - "configuration": { - "type": "cc65-vice", - "request": "launch", - "name": "CC65 Vice Launch", - "program": "${workspaceFolder}/program.c64", - "port": 6510, - "build": { - "cwd": "${workspaceFolder}", - "command": "make", - "skip": true, - "args": [ - "OPTIONS=mapfile,labelfile,debugfile" - ] - }, - "stopOnEntry": true, - "stopOnExit": true, - "emulatorArgs": [ - ] - } - } - } -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c185867..b35837a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,9 +1,7 @@ { "recommendations": [ -// "ms-vscode.cpptools", - "entan-gl.cc65-vice", -// "sharpninja.cc65", - "llvm-vs-code-extensions.vscode-clangd" + "llvm-vs-code-extensions.vscode-clangd", + "sharpninja.cc65" ], - "unwantedRecommendations": ["sharpninja.cc65", "tlgkccampbell.code-ca65"] + "unwantedRecommendations": ["tlgkccampbell.code-ca65"] } \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 76b7ce5..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "cc65-vice", - "request": "launch", - "name": "CC65 Vice Launch", - "program": "${workspaceFolder}/program.c64", - "debugFile": "${workspaceFolder}/program.c64.dbg", - "mapFile": "${workspaceFolder}/program.c64.map", - "build": { - "cwd": "${workspaceFolder}", - "command": "make", - "args": [ - "OPTIONS=mapfile,labelfile,debugfile" - ] - }, - "stopOnEntry": true, - "stopOnExit": true, - "emulatorArgs": [ - ] - }, - { - "type": "cc65-vice", - "request": "attach", - "name": "CC65 Vice Attach (PET)", - "program": "${workspaceFolder}/program.pet", - "debugFile": "${workspaceFolder}/program.pet.dbg", - "mapFile": "${workspaceFolder}/program.pet.map", - "build": { - "cwd": "${workspaceFolder}", - }, - "stopOnEntry": true, - "stopOnExit": true, - "port": 29784, - }, - { - "type": "cc65-vice", - "request": "launch", - "name": "CC65 Vice Launch (PET)", - "program": "${workspaceFolder}/program.pet", - "debugFile": "${workspaceFolder}/program.pet.dbg", - "mapFile": "${workspaceFolder}/program.pet.map", - "build": { - "cwd": "${workspaceFolder}", - "command": "make", - "args": [ - "OPTIONS=mapfile,labelfile,debugfile" - ] - }, - "stopOnEntry": true, - "stopOnExit": true, - "emulatorArgs": [ - ] - }, - { - "type": "cc65-vice", - "request": "launch", - "name": "CC65 Vice Launch (Debug Extension)", - "program": "${workspaceFolder}/program.c64", - "build": { - "cwd": "${workspaceFolder}", - "command": "make", - "args": [ - "OPTIONS=mapfile,labelfile,debugfile" - ] - }, - "port": 5050, - "stopOnEntry": false, - "stopOnExit": false, - "emulatorArgs": [ - ], - "debugServer": 4711 - }, - { - "type": "cc65-vice", - "request": "launch", - "name": "CC65 Vice Launch (NES) (Debug Extension)", - "program": "${workspaceFolder}/program.nes", - "debugFile": "${workspaceFolder}/program.nes.dbg", - "mapFile": "${workspaceFolder}/program.nes.map", - "build": { - "cwd": "${workspaceFolder}", - "command": "make", - "args": [ - "OPTIONS=mapfile,labelfile,debugfile" - ] - }, - "stopOnEntry": true, - "stopOnExit": true, - "emulatorArgs": [ - ], - "debugServer": 4711 - }, - { - "type": "cc65-vice", - "request": "attach", - "name": "CC65 Vice Attach (PET) (Debug Extension)", - "program": "${workspaceFolder}/program.pet", - "debugFile": "${workspaceFolder}/program.pet.dbg", - "mapFile": "${workspaceFolder}/program.pet.map", - "build": { - "cwd": "${workspaceFolder}", - }, - "stopOnEntry": true, - "stopOnExit": true, - "port": 29784, - "debugServer": 4711 - }, - { - "type": "cc65-vice", - "request": "launch", - "name": "CC65 Vice Launch (PET) (Debug Extension)", - "program": "${workspaceFolder}/program.pet", - "debugFile": "${workspaceFolder}/program.pet.dbg", - "mapFile": "${workspaceFolder}/program.pet.map", - "build": { - "cwd": "${workspaceFolder}", - "command": "make", - "args": [ - "OPTIONS=mapfile,labelfile,debugfile" - ] - }, - "stopOnEntry": true, - "stopOnExit": true, - "emulatorArgs": [ - ], - "debugServer": 4711 - } - ] -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e2c767a..48b3c88 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,26 +1,25 @@ { - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "options": { - "env": { - "ELECTRON_RUN_AS_NODE": "1" - } - }, - "tasks": [ - { - "label": "Build", - "type": "shell", - "group": { - "kind": "build", - "isDefault": true - }, - "windows": { - "command": "\"${workspaceFolder}/mk.bat\"" - }, - "linux": { - "command": "sh \"${workspaceFolder}/mk.sh\"" - } - } - ] + "version": "2.0.0", + "tasks": [ + { + "label": "Make out", + "type": "shell", + "command": "mkdir out" + }, + { + "label": "Build program", + "type": "shell", + "command": "cl65 src/main.c -o out/program.c64" + }, + { + "label": "Run program", + "type": "shell", + "command": " x64sc.exe out/program.c64" + }, + { + "label": "Build & run program", + "type": "shell", + "command": "cl65 src/main.c -o out/program.c64 && x64sc.exe out/program.c64" + } + ] } \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index 2da8e53..0000000 --- a/Makefile +++ /dev/null @@ -1,345 +0,0 @@ -############################################################################### -### Generic Makefile for cc65 projects - full version with abstract options ### -### V1.3.0(w) 2010 - 2013 Oliver Schmidt & Patryk "Silver Dream !" Ɓogiewa ### -############################################################################### - -############################################################################### -### In order to override defaults - values can be assigned to the variables ### -############################################################################### - -# Space or comma separated list of cc65 supported target platforms to build for. -# Default: c64 (lowercase!) -TARGETS := c64 - -# Name of the final, single-file executable. -# Default: name of the current dir with target name appended -PROGRAM := src/program - -# Path(s) to additional libraries required for linking the program -# Use only if you don't want to place copies of the libraries in SRCDIR -# Default: none -LIBS := - -# Custom linker configuration file -# Use only if you don't want to place it in SRCDIR -# Default: none -CONFIG := - -# Additional C compiler flags and options. -# Default: none -CFLAGS = -g - -# Additional assembler flags and options. -# Default: none -ASFLAGS = -g - -# Additional linker flags and options. -# Default: none -LDFLAGS = -g - -# Path to the directory containing C and ASM sources. -# Default: src -SRCDIR := - -# Path to the directory where object files are to be stored (inside respective target subdirectories). -# Default: obj -OBJDIR := - -# Command used to run the emulator. -# Default: depending on target platform. For default (c64) target: x64 -kernal kernal -VICIIdsize -autoload -EMUCMD := x64sc -initbreak 2112 -autostart - -# Optional commands used before starting the emulation process, and after finishing it. -# Default: none -# Examples -#PREEMUCMD := osascript -e "tell application \"System Events\" to set isRunning to (name of processes) contains \"X11.bin\"" -e "if isRunning is true then tell application \"X11\" to activate" -#PREEMUCMD := osascript -e "tell application \"X11\" to activate" -#POSTEMUCMD := osascript -e "tell application \"System Events\" to tell process \"X11\" to set visible to false" -#POSTEMUCMD := osascript -e "tell application \"Terminal\" to activate" -PREEMUCMD := -POSTEMUCMD := - -# On Windows machines VICE emulators may not be available in the PATH by default. -# In such case, please set the variable below to point to directory containing -# VICE emulators. -#VICE_HOME := "C:\Program Files\WinVICE-2.2-x86\" -VICE_HOME := - -# Options state file name. You should not need to change this, but for those -# rare cases when you feel you really need to name it differently - here you are -STATEFILE := Makefile.options - -################################################################################### -#### DO NOT EDIT BELOW THIS LINE, UNLESS YOU REALLY KNOW WHAT YOU ARE DOING! #### -################################################################################### - -################################################################################### -### Mapping abstract options to the actual compiler, assembler and linker flags ### -### Predefined compiler, assembler and linker flags, used with abstract options ### -### valid for 2.14.x. Consult the documentation of your cc65 version before use ### -################################################################################### - -# Compiler flags used to tell the compiler to optimise for SPEED -define _optspeed_ - CFLAGS += -Oris -endef - -# Compiler flags used to tell the compiler to optimise for SIZE -define _optsize_ - CFLAGS += -Or -endef - -# Compiler and assembler flags for generating listings -define _listing_ - CFLAGS += --listing $$(@:.o=.lst) - ASFLAGS += --listing $$(@:.o=.lst) - REMOVES += $(addsuffix .lst,$(basename $(OBJECTS))) -endef - -# Linker flags for generating map file -define _mapfile_ - LDFLAGS += --mapfile $$@.map - REMOVES += $(PROGRAM).map -endef - -# Linker flags for generating VICE label file -define _labelfile_ - LDFLAGS += -Ln $$@.lbl - REMOVES += $(PROGRAM).lbl -endef - -# Linker flags for generating a debug file -define _debugfile_ - LDFLAGS += -Wl --dbgfile,$$@.dbg - REMOVES += $(PROGRAM).dbg -endef - -############################################################################### -### Defaults to be used if nothing defined in the editable sections above ### -############################################################################### - -# Presume the C64 target like the cl65 compile & link utility does. -# Set TARGETS to override. -ifeq ($(TARGETS),) - TARGETS := c64 -endif - -# Presume we're in a project directory so name the program like the current -# directory. Set PROGRAM to override. -ifeq ($(PROGRAM),) - PROGRAM := $(notdir $(CURDIR)) -endif - -# Presume the C and asm source files to be located in the subdirectory 'src'. -# Set SRCDIR to override. -ifeq ($(SRCDIR),) - SRCDIR := src -endif - -# Presume the object and dependency files to be located in the subdirectory -# 'obj' (which will be created). Set OBJDIR to override. -ifeq ($(OBJDIR),) - OBJDIR := obj -endif -TARGETOBJDIR := $(OBJDIR)/$(TARGETS) - -# Default emulator commands and options for particular targets. -# Set EMUCMD to override. -c64_EMUCMD := $(VICE_HOME)x64 -kernal kernal -VICIIdsize -autoload -c128_EMUCMD := $(VICE_HOME)x128 -kernal kernal -VICIIdsize -autoload -vic20_EMUCMD := $(VICE_HOME)xvic -kernal kernal -VICdsize -autoload -pet_EMUCMD := $(VICE_HOME)xpet -Crtcdsize -autoload -plus4_EMUCMD := $(VICE_HOME)xplus4 -TEDdsize -autoload -# So far there is no x16 emulator in VICE (why??) so we have to use xplus4 with -memsize option -c16_EMUCMD := $(VICE_HOME)xplus4 -ramsize 16 -TEDdsize -autoload -cbm510_EMUCMD := $(VICE_HOME)xcbm2 -model 510 -VICIIdsize -autoload -cbm610_EMUCMD := $(VICE_HOME)xcbm2 -model 610 -Crtcdsize -autoload -atari_EMUCMD := atari800 -windowed -xl -pal -nopatchall -run -cx16_EMUCMD := x16emu -run -prg - -ifeq ($(EMUCMD),) - EMUCMD = $($(CC65TARGET)_EMUCMD) -endif - -############################################################################### -### The magic begins ### -############################################################################### - -# The "Native Win32" GNU Make contains quite some workarounds to get along with -# cmd.exe as shell. However it does not provide means to determine that it does -# actually activate those workarounds. Especially $(SHELL) does NOT contain the -# value 'cmd.exe'. So the usual way to determine if cmd.exe is being used is to -# execute the command 'echo' without any parameters. Only cmd.exe will return a -# non-empty string - saying 'ECHO is on/off'. -# -# Many "Native Win32" programs accept '/' as directory delimiter just fine. How- -# ever the internal commands of cmd.exe generally require '\' to be used. -# -# cmd.exe has an internal command 'mkdir' that doesn't understand nor require a -# '-p' to create parent directories as needed. -# -# cmd.exe has an internal command 'del' that reports a syntax error if executed -# without any file so make sure to call it only if there's an actual argument. -ifeq ($(shell echo),) - MKDIR = mkdir -p $1 - RMDIR = rmdir $1 - RMFILES = $(RM) $1 -else - MKDIR = mkdir $(subst /,\,$1) - RMDIR = rmdir $(subst /,\,$1) - RMFILES = $(if $1,del /f $(subst /,\,$1)) -endif -COMMA := , -SPACE := $(N/A) $(N/A) -define NEWLINE - - -endef -# Note: Do not remove any of the two empty lines above ! - -TARGETLIST := $(subst $(COMMA),$(SPACE),$(TARGETS)) - -ifeq ($(words $(TARGETLIST)),1) - -# Set PROGRAM to something like 'myprog.c64'. -override PROGRAM := $(PROGRAM).$(TARGETLIST) - -CSOURCES := $(wildcard $(SRCDIR)/*.c) -CSOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.c) - -# Set SOURCES to something like 'src/foo.c src/bar.s'. -# Use of assembler files with names ending differently than .s is deprecated! -SOURCES := $(CSOURCES) -SOURCES += $(wildcard $(SRCDIR)/*.s) -SOURCES += $(wildcard $(SRCDIR)/*.asm) -SOURCES += $(wildcard $(SRCDIR)/*.a65) - -# Add to SOURCES something like 'src/c64/me.c src/c64/too.s'. -# Use of assembler files with names ending differently than .s is deprecated! -SOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.s) -SOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.asm) -SOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.a65) - -# Set OBJECTS to something like 'obj/c64/foo.o obj/c64/bar.o'. -OBJECTS := $(addsuffix .o,$(basename $(addprefix $(TARGETOBJDIR)/,$(notdir $(SOURCES))))) - -# Set INTERMEDIATES to something like 'obj/c64/foo.i obj/c64/bar.i'. -INTERMEDIATES := $(addsuffix .i,$(basename $(addprefix $(TARGETOBJDIR)/,$(notdir $(CSOURCES))))) - -# Set DEPENDS to something like 'obj/c64/foo.d obj/c64/bar.d'. -DEPENDS := $(OBJECTS:.o=.d) - -# Set TABS to something like 'obj/c64/foo.tab obj/c64/bar.tab'. -TABS := $(OBJECTS:.o=.tab) - -# Add to LIBS something like 'src/foo.lib src/c64/bar.lib'. -LIBS += $(wildcard $(SRCDIR)/*.lib) -LIBS += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.lib) - -# Add to CONFIG something like 'src/c64/bar.cfg src/foo.cfg'. -CONFIG += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.cfg) -CONFIG += $(wildcard $(SRCDIR)/*.cfg) - -# Select CONFIG file to use. Target specific configs have higher priority. -ifneq ($(word 2,$(CONFIG)),) - CONFIG := $(firstword $(CONFIG)) - $(info Using config file $(CONFIG) for linking) -endif - -.SUFFIXES: -.PHONY: all test clean zap love - -all: $(PROGRAM) - --include $(DEPENDS) --include $(STATEFILE) - -# If OPTIONS are given on the command line then save them to STATEFILE -# if (and only if) they have actually changed. But if OPTIONS are not -# given on the command line then load them from STATEFILE. Have object -# files depend on STATEFILE only if it actually exists. -ifeq ($(origin OPTIONS),command line) - ifneq ($(OPTIONS),$(_OPTIONS_)) - ifeq ($(OPTIONS),) - $(info Removing OPTIONS) - $(shell $(RM) $(STATEFILE)) - $(eval $(STATEFILE):) - else - $(info Saving OPTIONS=$(OPTIONS)) - $(shell echo _OPTIONS_=$(OPTIONS) > $(STATEFILE)) - endif - $(eval $(OBJECTS): $(STATEFILE)) - endif -else - ifeq ($(origin _OPTIONS_),file) - $(info Using saved OPTIONS=$(_OPTIONS_)) - OPTIONS = $(_OPTIONS_) - $(eval $(OBJECTS): $(STATEFILE)) - endif -endif - -# Transform the abstract OPTIONS to the actual cc65 options. -$(foreach o,$(subst $(COMMA),$(SPACE),$(OPTIONS)),$(eval $(_$o_))) - -# Strip potential variant suffix from the actual cc65 target. -CC65TARGET := $(firstword $(subst .,$(SPACE),$(TARGETLIST))) - -# The remaining targets. -$(TARGETOBJDIR): - $(call MKDIR,$@) - -vpath %.c $(SRCDIR)/$(TARGETLIST) $(SRCDIR) - -$(TARGETOBJDIR)/%.o: %.c | $(TARGETOBJDIR) - cl65 -t $(CC65TARGET) -c --create-dep $(@:.o=.d) -Wc "--debug-tables" -Wc "$(@:.o=.tab)" $(CFLAGS) -o $@ $< - -vpath %.s $(SRCDIR)/$(TARGETLIST) $(SRCDIR) - -$(TARGETOBJDIR)/%.o: %.s | $(TARGETOBJDIR) - cl65 -t $(CC65TARGET) -c --create-dep $(@:.o=.d) $(ASFLAGS) -o $@ $< - -vpath %.asm $(SRCDIR)/$(TARGETLIST) $(SRCDIR) - -$(TARGETOBJDIR)/%.o: %.asm | $(TARGETOBJDIR) - cl65 -t $(CC65TARGET) -c --create-dep $(@:.o=.d) $(ASFLAGS) -o $@ $< - -vpath %.a65 $(SRCDIR)/$(TARGETLIST) $(SRCDIR) - -$(PROGRAM): $(CONFIG) $(OBJECTS) $(LIBS) - cl65 -t $(CC65TARGET) $(LDFLAGS) -o $@ $(patsubst %.cfg,-C %.cfg,$^) - -test: $(PROGRAM) - $(PREEMUCMD) - $(EMUCMD) $< - $(POSTEMUCMD) - -clean: - $(call RMFILES,$(OBJECTS)) - $(call RMFILES,$(DEPENDS)) - $(call RMFILES,$(TABS)) - $(call RMFILES,$(REMOVES)) - $(call RMFILES,$(PROGRAM)) - -else # $(words $(TARGETLIST)),1 - -all test clean: - $(foreach t,$(TARGETLIST),$(MAKE) TARGETS=$t $@$(NEWLINE)) - -endif # $(words $(TARGETLIST)),1 - -OBJDIRLIST := $(wildcard $(OBJDIR)/*) - -zap: - $(foreach o,$(OBJDIRLIST),-$(call RMFILES,$o/*.o $o/*.d $o/*.lst)$(NEWLINE)) - $(foreach o,$(OBJDIRLIST),-$(call RMDIR,$o)$(NEWLINE)) - -$(call RMDIR,$(OBJDIR)) - -$(call RMFILES,$(basename $(PROGRAM)).* $(STATEFILE)) - -love: - @echo "Not war, eh?" - -################################################################### -### Place your additional targets in the additional Makefiles ### -### in the same directory - their names have to end with ".mk"! ### -################################################################### --include *.mk \ No newline at end of file diff --git a/Makefile.options b/Makefile.options deleted file mode 100644 index 670438a..0000000 --- a/Makefile.options +++ /dev/null @@ -1 +0,0 @@ -_OPTIONS_=mapfile,labelfile,debugfile diff --git a/mk.bat b/mk.bat deleted file mode 100644 index 05264f3..0000000 --- a/mk.bat +++ /dev/null @@ -1,13 +0,0 @@ -pushd %~dp0 -set SCRIPT_DIR=%CD% -popd - -for /D %%I in ("%USERPROFILE%\.vscode\extensions\entan-gl.cc65-vice-*") do @set EXTENSION_PATH=%%~I\build.bat - -if exist "%SCRIPT_DIR%\..\..\..\build.bat" ( - "%SCRIPT_DIR%\..\..\..\build.bat" make.exe %* -) else if exist "%EXTENSION_PATH%" ( - "%EXTENSION_PATH%" make.exe %* -) else ( - make.exe %* -) \ No newline at end of file diff --git a/mk.sh b/mk.sh deleted file mode 100755 index 626af56..0000000 --- a/mk.sh +++ /dev/null @@ -1,8 +0,0 @@ -DIR="$( cd "$( dirname "$(readlink -f "$0")" )" > /dev/null && pwd )" -if test -e "$DIR/../../../build.sh"; then - sh "$DIR/../../../build.sh" make "$@" -elif test -e "$SHPATH"; then - sh "$SHPATH" make "$@" -else - make "$@" -fi diff --git a/readme.md b/readme.md index 6189750..f62d991 100644 --- a/readme.md +++ b/readme.md @@ -32,5 +32,6 @@ to run hello world Useful https://sta.c64.org/cbm64mem.html -Using template from +Using template from, but gave up on it + https://github.com/empathicqubit/vscode-cc65-debugger/tree/master/src/__tests__/c-project-template \ No newline at end of file diff --git a/src/program.c64 b/src/main.c similarity index 100% rename from src/program.c64 rename to src/main.c