diff --git a/v2/asm/.gitignore b/v2/asm/.gitignore new file mode 100644 index 0000000..b0a52f0 --- /dev/null +++ b/v2/asm/.gitignore @@ -0,0 +1,2 @@ +build.lst +build.sym diff --git a/v2/asm/Makefile b/v2/asm/Makefile index 9c23c34..69520f8 100644 --- a/v2/asm/Makefile +++ b/v2/asm/Makefile @@ -5,8 +5,7 @@ WINE = wine C1541 = c1541 -C64LIST4BETAA = $(WINE) c64list4_00-beta-a.exe # needed for .bin generation/inclusion -C64LIST4BETAC = $(WINE) c64list4_00-beta-c.exe # latest version +C64LIST = $(WINE) /bin/C64List.exe # needed for .bin generation/inclusion DISKIMAGE = test-ml20.d64 C64_FILENAME = "ml 2.0" # c64list: petscii translation results in "ml 2.0", but it can't output both .prg and to .d64 in a single command line @@ -23,8 +22,8 @@ all: ml20.prg # @rm $@.in # (foreach variable,list,text) -# $(foreach O,$(basename $(OBJECTS)),$(echo "wine $(C64LIST4BETAC) @$@.asm -prg" $O)) -# echo wine $(C64LIST4BETAC) @$@ -prg +# $(foreach O,$(basename $(OBJECTS)),$(echo "wine $(C64LIST) @$@.asm -prg" $O)) +# echo wine $(C64LIST) @$@ -prg # @rm $@.in # *.lbl files are being kept as BASIC programs. @@ -37,28 +36,26 @@ PREREQS = wedge.bin editor.bin garbage-collect.bin ecs.bin struct.bin \ swap1.bin swap2.bin swap3.bin %.bin: %.asm - # this must stay beta a for now; this version outputs and includes .bin files - $(C64LIST4BETAA) $< -bin:$@ + $(C64LIST) $< -bin:$@ # 2) call build.asm, include *.asm files not listed in $(PREREQS) ml20.prg: $(PREREQS) build.asm - # need beta a since it embeds .bin files - $(C64LIST4BETAA) build.asm -verbose -prg:ml20.prg + $(C64LIST) build.asm -verbose -prg:ml20.prg # output symbols - $(C64LIST4BETAA) build.asm -sym + $(C64LIST) build.asm -sym # TODO: make one-byte zp symbols ($61) two bytes ($0061) for purposes of sorting and ease of diff'ing # sort symbols $(shell sort build.sym -t $ --key 2) # output disassembly - $(C64LIST4BETAA) build.asm -lst + $(C64LIST) build.asm -lst # write ml 2.0 to disk $(C1541) $(DISKIMAGE) -write $@ $(C64_FILENAME) -dir # $(DISKIMAGE): ml20.prg # $(C1541) -format "test,rs" d64 $(DISKIMAGE) # # import ml20.prg into $(DISKIMAGE) as "ml 2.0" -# $(C64LIST4BETAC) $< -d64:$@::$(C64_FILENAME) +# $(C64LIST) $< -d64:$@::$(C64_FILENAME) # # show contents # $(C1541) $(DISKIMAGE) -dir @@ -100,7 +97,7 @@ ml20.prg: $(PREREQS) build.asm # $(C1541) $(OUTPUT_PATH)/$(OUTPUT_DISK) -del ml.$(basename $@) -write $(OUTPUT_PATH)/$(basename $@).prg ml.$(basename $@) # Include build date of module -# C64LIST4BETAC does this with build revision tracking +# C64LIST does this with build revision tracking # Example usage: bd$={usedef:__BuildDate}:bt$={usedef:__BuildTime} # The "make disk" target will add all the *.prg files to a .d81 at once @@ -120,7 +117,7 @@ ml20.prg: $(PREREQS) build.asm clean: # "-" prefix allows 'clean' to continue despite possible missing files - -rm *.bin *.prg *.lst $(DISKIMAGE) + -rm -f build.sym *.bin *.prg *.lst $(DISKIMAGE) $(C1541) -format "test,rs" d64 $(DISKIMAGE) # FIXME: not sure this really works diff --git a/v2/asm/README.md b/v2/asm/README.md index 6b436a8..16e4c24 100644 --- a/v2/asm/README.md +++ b/v2/asm/README.md @@ -10,4 +10,14 @@ Vice can also load label files created by the Acme assembler. Their syntax is e. `labelname = $1234 ; Maybe a comment`. A dot will be added automatically to label names assigned in this way to fit to the Vice label syntax. -Pipe the `.sym` file generated by `wine casm.exe -sym | dos2unix` to fix line endings for Linux VICE. +To change Windows' CR/LF line endings to Linux's LF line endings: `wine c64list.exe -sym | dos2unix` + +## Docker-based build + +The `./v2/asm` directory can be built inside a Docker container to ease environment setup. + +Prerequisites: +* Ensure you have Docker installed on your system. +* Ensure your user account is part of the `docker` group. Sample command: `sudo usermod -G docker -a $(whoami)` + +Execute `./build.sh` to execute the build. Once the build completes, note the `*.bin` files in the current directory. diff --git a/v2/asm/build.asm b/v2/asm/build.asm index a0d9c15..914cad9 100644 --- a/v2/asm/build.asm +++ b/v2/asm/build.asm @@ -19,7 +19,7 @@ orig $6c00 ; wedge: load addr $0c00, reloc $0c00 {info:embedding wedge.bin} - embed wedge.bin + embed "wedge.bin" ; orig: the individual .bin file's load address ; embed: where in RAM the .bin file gets put ; reloc: where in RAM the module gets relocated to after "ml 2.0" loads @@ -28,44 +28,44 @@ orig $6c00 {info:Aligning to $7000.} orig $7000 {info:embedding editor.bin} - embed editor.bin + embed "editor.bin" {info:Aligning to $8000.} orig $8000 ; orig $c000, embed $8000, reloc $e000: garbage collect {info:embedding garbage-collect.bin} - embed garbage-collect.bin + embed "garbage-collect.bin" {info:Aligning to $8400.} orig $8400 ; orig $c000, embed $8400, reloc $e400: e.c.s. checker {info:embedding ecs.bin} - embed ecs.bin + embed "ecs.bin" {info:Aligning to $8e00.} orig $8e00 ; orig $c000, embed $8e00, reloc $ee00: struct {info:embedding struct.bin} - embed struct.bin + embed "struct.bin" {info:Aligning to $9400.} orig $9400 ; orig $c000, embed $9400, reloc $f400: swap1 {info:embedding swap1.bin} - embed swap1.bin + embed "swap1.bin" {info:Aligning to $9800.} orig $9800 ; orig $c000, embed $9800, reloc $f800: swap2 {info:embedding swap2.bin} - embed swap2.bin + embed "swap2.bin" {info:Aligning to $9c00.} orig $9c00 ; orig $c000, embed $9c00, reloc $fc00: swap3 {info:embedding swap3.bin} - embed swap3.bin + embed "swap3.bin" {info:Aligning to $a000.} orig $a000 diff --git a/v2/asm/build.sh b/v2/asm/build.sh new file mode 100755 index 0000000..12d3d87 --- /dev/null +++ b/v2/asm/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Ensure Docker is available +if ! docker info &>/dev/null; then + echo "ERROR: Please ensure you have Docker installed and that your shell user is part of the 'docker' group" 1>&2 + exit 1 +fi + +# Build Docker image +# Will use cached copy if already built +(cd ../docker && ./build.sh) + +# Execute build inside Docker container + +docker run -it --rm -v $(pwd):/asm imagebbs_docker:latest bash -c "cd /asm && make clean all" diff --git a/v2/asm/equates-2_0.asm b/v2/asm/equates-2_0.asm index 911f226..bf12274 100644 --- a/v2/asm/equates-2_0.asm +++ b/v2/asm/equates-2_0.asm @@ -2,6 +2,12 @@ ; Image BBS v2.0 equates ; +; +; printable characters +; + + comma = $2c + ; [1.2]: labels/memory address is the same as 1.2 ; [?] : not certain of purpose of routine ; ($xx): Indirect addressing: $xx *256+ ($xx+1) @@ -345,8 +351,7 @@ frmevl = $ad9e ; evaluate string/math expressions eval1 = $ae8d parchk = $aef1 ; parentheses check: '(' - comma = $aefd ; check next character is comma, ... - chkcom = $aefd ; ...return "?syntax error" if not + chkcom = $aefd ; check if next character is comma, return "?syntax error" if not synerr = $af08 ; emit "?syntax error" ptrget1 = $b0e7 ; set up descriptor stored in ($45) [varname], diff --git a/v2/asm/irqhn.asm b/v2/asm/irqhn.asm index fd2c0f0..26ec536 100644 --- a/v2/asm/irqhn.asm +++ b/v2/asm/irqhn.asm @@ -312,7 +312,7 @@ dispd3: jsr dispdt lda d1str+6 jsr dispdt - lda #',' + lda #comma jsr dispdt lda #' ' jsr dispdt diff --git a/v2/asm/swap3.asm b/v2/asm/swap3.asm index 83a81be..890d9bc 100644 --- a/v2/asm/swap3.asm +++ b/v2/asm/swap3.asm @@ -119,7 +119,7 @@ movie1: pha jsr clrchn ldx movdly - ldy#0 + ldy #0 dl1: dey bne dl1 diff --git a/v2/docker/Dockerfile b/v2/docker/Dockerfile new file mode 100644 index 0000000..9f5e408 --- /dev/null +++ b/v2/docker/Dockerfile @@ -0,0 +1,38 @@ +FROM ubuntu:latest + +RUN apt-get update \ + && apt install -y --no-install-recommends \ + apt-transport-https \ + bison \ + build-essential \ + ca-certificates \ + flex \ + git \ + gnupg \ + gpg-agent \ + libreadline-dev \ + libxaw7-dev \ + unzip \ + wget + +# Adapted from https://github.com/scottyhardy/docker-wine/blob/master/Dockerfile +# Install wine +ARG WINE_BRANCH="stable" +ARG C64LIST_VER="4.04" +RUN wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \ + && echo "deb https://dl.winehq.org/wine-builds/ubuntu/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list \ + && dpkg --add-architecture i386 \ + && DEBIAN_FRONTEND="noninteractive" apt-get install -y --install-recommends wine-${WINE_BRANCH} + +RUN apt install -y libwine --install-recommends \ + && apt update \ + && apt install -y wine32 --no-install-recommends + + +# Configure locale for unicode +#RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 + +COPY files/C64List${C64LIST_VER}/Win32/C64List.exe /bin/C64List.exe + +RUN apt install -y vice diff --git a/v2/docker/build.sh b/v2/docker/build.sh new file mode 100755 index 0000000..d70c203 --- /dev/null +++ b/v2/docker/build.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +docker build -t imagebbs_docker . diff --git a/v2/docker/files/C64List4.04/Win32/C64List.exe b/v2/docker/files/C64List4.04/Win32/C64List.exe new file mode 100644 index 0000000..1789ede Binary files /dev/null and b/v2/docker/files/C64List4.04/Win32/C64List.exe differ diff --git a/v2/docker/files/C64List4.04/Win64/C64List.exe b/v2/docker/files/C64List4.04/Win64/C64List.exe new file mode 100644 index 0000000..cbebda3 Binary files /dev/null and b/v2/docker/files/C64List4.04/Win64/C64List.exe differ diff --git a/v2/docker/files/README.md b/v2/docker/files/README.md new file mode 100644 index 0000000..adcc5c8 --- /dev/null +++ b/v2/docker/files/README.md @@ -0,0 +1,5 @@ +# C64List + +The C64List binaries and .docx files were downloaded from (here)[http://commodoreserver.com/BlogEntryView.asp?EID=8AA5A8C601114E8C8FEEC094A758FABA] +and are included in this Git repository for simplicity. +