diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..34cac5f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,62 @@ +name: Build + +on: + push: + branches: + - main + - '*' + pull_request: + branches: + - main + - '*' + +env: + # Path to the solution file relative to the root of the project. + SOLUTION_FILE_PATH: . + +permissions: + contents: read + +defaults: + run: + shell: bash {0} + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Setup Requirements + run: | + sudo apt-get install jam + + - name: Checkout + uses: actions/checkout@v4 + + - name: Fetch Toolshed + uses: robinraju/release-downloader@v1 + with: + repository: nitros9project/toolshed + fileName: toolshed-*.tgz + latest: true + extract: false + out-file-path: toolshed + + - name: Install Toolshed + run: | + sudo tar xvf toolshed/toolshed-[0-9]*.*.tgz --strip-components=1 -C /usr/local/bin + sudo ln -s /bin/bash /usr/local/bin/xroar + + - name: Install Lwtools + run: | + sudo bash ./setup/lwtools.sh + + - name: Build + run: | + jam balls + + - name: Display structure of downloaded files + run: ls -al + + + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b5ed5ef --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,64 @@ +name: Release + +on: + push: + tags: + - 'v*' + +env: + # Path to the solution file relative to the root of the project. + SOLUTION_FILE_PATH: . + +permissions: + contents: write + +defaults: + run: + shell: bash {0} + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Setup Requirements + run: | + sudo apt-get install jam + + - name: Checkout + uses: actions/checkout@v4 + + - name: Fetch Toolshed + uses: robinraju/release-downloader@v1 + with: + repository: nitros9project/toolshed + fileName: toolshed-*.tgz + latest: true + extract: false + out-file-path: toolshed + + - name: Install Toolshed + run: | + sudo tar xvf toolshed/toolshed-[0-9]*.*.tgz --strip-components=1 -C /usr/local/bin + sudo ln -s /bin/bash /usr/local/bin/xroar + + - name: Install Lwtools + run: | + sudo bash ./setup/lwtools.sh + + - name: Build + run: | + tag=$(git describe --tags --abbrev=0) + jam -sTAG=$tag balls + + - name: Display structure of downloaded files + run: ls -al + + - name: Release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: "craigtst-*.tgz" + + diff --git a/Jamfile b/Jamfile index b4c63eb..ebcc032 100644 --- a/Jamfile +++ b/Jamfile @@ -1,20 +1,25 @@ - -SubDir coco-test ; - -disk = [ FDirName $(TOP) itest.dsk ] ; - -ASM = [ Glob $(SUBDIR) : *.asm ] ; - -TARGETS = i1.asm i2.asm i3.asm ; - -DEPS = $(DEP:S=.asm) ; - -for t in $(TARGETS:BS) -{ - local out = [ Assembly $(t) ] ; - Run $(out) : $(disk) : $(files:U) : $(disk2) ; - Depends $(out) : $(DEPS) ; - LOCATE on $(DEPS) = $(SUBDIR) ; -} - -DecbCopyAll $(disk) : $(ASM) ; + +SubDir coco-test ; + +disk = [ FDirName $(TOP) craigtst.dsk ] ; + +ASM = [ Glob $(SUBDIR) : *.asm ] ; + +TARGETS = i1.asm i2.asm i3.asm ; + +DEPS = $(DEP:S=.asm) ; + +for t in $(TARGETS:BS) +{ + local out = [ Assembly $(t) ] ; + Run $(out) : $(disk) : $(files:U) : $(disk2) ; + Depends $(out) : $(DEPS) ; + LOCATE on $(DEPS) = $(SUBDIR) ; +} + +TAG ?= v0.0 ; +VERSION = craigtst-$(TAG) ; + +Ball $(VERSION).tgz : $(disk) ; + + diff --git a/Jamrules b/Jamrules index 0cd3ef4..fac6737 100644 --- a/Jamrules +++ b/Jamrules @@ -1,232 +1,270 @@ -# Whitespace around ; is significant in Jam so watch out. - -SPACE = " " ; - -if $(OS) = NT -{ - # I've put my tools here: - TOOL_PATH = [ FDirName c: Programs ] ; - - # tool paths - LWTOOLS_PATH = [ FDirName $(TOOL_PATH) lwtools-4.24c ] ; - TOOLSHED_PATH = [ FDirName $(TOOL_PATH) toolshed-2.2 ] ; - VCC_PATH = [ FDirName $(TOOL_PATH) vcc-2.1.9.1 ] ; - XROAR_PATH = [ FDirName $(TOOL_PATH) xroar-1.8.1 ] ; -} -else -{ - TOOL_PATH = [ FDirName / usr local bin ] ; - - # tool paths - LWTOOLS_PATH = $(TOOL_PATH) ; - TOOLSHED_PATH = [ FDirName ~ toolshed-2.2 ] ; - VCC_PATH = ; - XROAR_PATH = $(TOOL_PATH) ; -} - - -# tools -DECB = [ FDirName $(TOOLSHED_PATH) decb$(SUFEXE) ] ; -VCC = [ FDirName $(VCC_PATH) vcc$(SUFEXE) ] ; -XROAR = [ FDirName $(XROAR_PATH) xroar$(SUFEXE) ] ; -LWASM = [ FDirName $(LWTOOLS_PATH) lwasm$(SUFEXE) ] ; - -# shorthands -SHORT on xroar = x ; -SHORT on vcc = v ; - - -# -# Exists f - is true if 'f' exists. -# -rule Exists -{ - local p = $(<:P) ; - - if $(VERBOSE) >= 5 - { - Echo $(p) ; - } - - if ! $($(p)) - { - local files = [ Glob $(<:P) : * ] ; - $(p) = $(files:BS) ; - } - - if $(<:BS) in $($(p)) - { - if $(VERBOSE) >= 5 - { - Echo Found $(<:BS) ; - } - return 1 ; - } - - return ; -} - -if ! [ Exists $(TOOLSHED) ] -{ - Echo toolshed not found at path: $(TOOLSHED_PATH) ; -} - -if ! [ Exists $(LWTOOLS) ] -{ - Echo lwtools not found at path: $(LWTOOLS_PATH) ; -} - -if [ Exists $(VCC) ] -{ - HAVE_VCC = vcc ; -} - -if [ Exists $(XROAR) ] -{ - HAVE_XROAR = xroar ; -} - -EMULATORS = VCC XROAR ; -HAVE_EMULATOR = $(HAVE_$(EMULATORS)) ; - -if ! $(HAVE_EMULATOR) -{ - Exit No emulator found at path: $(VCC) or $(XROAR) ; -} - -if $(VERBOSE) > 1 -{ - Echo Have emulators: $(HAVE_EMULATOR) ; -} - -rule Assembly -{ - local target = $(<:US=.BIN) ; - local listing = $(<:US=.LST) ; - MakeLocate $(listing) : $(LOCATE_TARGET) ; - Assemble $(target) : $(<) ; - NoCare $(listing) ; - LISTING on $(target) = $(listing) ; - Clean clean : $(listing) ; - return $(target) ; -} - -rule Assemble -{ - MakeLocate $(<) : $(LOCATE_TARGET) ; - Depends $(<) : $(>) ; - Clean clean : $(<) ; - Depends asm : $(<) ; - NotFile asm ; -} - -actions Assemble -{ - $(LWASM) --6809 --list=$(LISTING) --symbols --6800compat --output=$(<[1]:U) --format=decb $(>) -} - -rule DecbCopy -{ - Decb $(<) : $(>) ; -} - -rule Decb -{ - Depends $(<) : $(>) ; - Depends disk : $(<) ; - NotFile disk ; -} - -actions Decb -{ - $(DECB) copy -2 -b $(>:U) -r $(<),$(>:U) -} - -rule DecbCopyAll disk : files -{ - local file ; - for file in $(files:BS) - { - DecbCopy $(disk) : $(file) ; - } -} - -rule MakeDisk disk -{ - if ! $($(<)-mkdsk) - { - $(<)-mkdsk = true ; - MakeDisk1 $(<) ; - Clean clean : $(<) ; - Depends dsk : $(<) ; - } -} - -actions MakeDisk1 -{ - $(DECB) dskini -4 $(<) -} - -rule RunToolOn tool : binary : disk : disk2 -{ - local run = run-$(tool:L) run-$(SHORT:L) ; - NotFile $(run) ; - Always $(run) ; - - local run_target = $(SHORT:L)-$(binary:BL) ; - $(tool:U) on $(run_target) = $(tool:U) ; - $(tool) $(run_target) : $(binary:U) : $(disk) : $(disk2) ; -} - -rule RunTool tool : binary : disk : disk2 -{ - if $(HAVE_$(tool:U)) - { - on $(tool:L) RunToolOn $(tool) : $(binary) : $(disk) : $(disk2) ; - } -} - -rule Run binary : disk : extrafiles : disk2 -{ - MakeLocate $(disk) : $(LOCATE_TARGET) ; - MakeDisk $(disk) ; - - DecbCopyAll $(disk) : $(binary) $(extrafiles) ; - - RunTool Vcc : $(binary) : $(disk) : $(disk2) ; - RunTool XRoar : $(binary) : $(disk) : $(disk2) ; -} - -rule Vcc target : binary : disk : disk2 -{ - Depends $(<) : $(disk) ; - NotFile $(<) ; - Always $(<) ; - VCC on $(<) = $(VCC) ; -} - -actions ignore Vcc -{ - $(VCC) $(>) -} - -rule XRoar target : binary : disk : disk2 -{ - DISK on $(target) = $(disk) ; - Depends $(target) : $(disk) ; - if $(disk2) - { - DISK2 on $(target) = $(disk2) ; - Depends $(target) : $(disk2) ; - } - - Depends $(target) : $(disk) ; - NotFile $(target) ; - Always $(target) ; - XROAR on $(<) = $(XROAR) ; -} - -actions ignore XRoar bind DISK DISK2 -{ - $(XROAR) -m coco3p -tv-type ntsc -gdb -joy-right mjoy0 -load-fd0$(SPACE)$(DISK) -load-fd1$(SPACE)$(DISK2) -run $(>) -} \ No newline at end of file +# Whitespace around ; is significant in Jam so watch out. + +SPACE = " " ; + +if $(OS) = NT +{ + # I've put my tools here: + TOOL_PATH = [ FDirName c: Programs ] ; + + # tool paths + LWTOOLS_PATH = [ FDirName $(TOOL_PATH) lwtools-4.24c ] ; + TOOLSHED_PATH = [ FDirName $(TOOL_PATH) toolshed-2.4 ] ; + VCC_PATH = [ FDirName $(TOOL_PATH) vcc-2.1.9.1 ] ; + XROAR_PATH = [ FDirName $(TOOL_PATH) xroar-1.8.1 ] ; +} +else +{ + TOOL_PATH = [ FDirName usr local bin ] ; + TOOL_PATH = /$(TOOL_PATH) ; + + # tools assumed to be in /usr/local/bin + LWTOOLS_PATH = $(TOOL_PATH) ; + TOOLSHED_PATH = $(TOOL_PATH) ; + VCC_PATH = $(TOOL_PATH) ; + XROAR_PATH = $(TOOL_PATH) ; + + #JAMSHELL ?= bash -c % ; +} + + +# tools +DECB = [ FDirName $(TOOLSHED_PATH) decb$(SUFEXE) ] ; +VCC = [ FDirName $(VCC_PATH) vcc$(SUFEXE) ] ; +XROAR = [ FDirName $(XROAR_PATH) xroar$(SUFEXE) ] ; +LWASM = [ FDirName $(LWTOOLS_PATH) lwasm$(SUFEXE) ] ; + +# shorthands +SHORT on xroar = x ; +SHORT on vcc = v ; + + +# +# Exists f - is true if 'f' exists. +# +rule Exists +{ + local p = $(<:P) ; + + if $(VERBOSE) >= 5 + { + Echo $(p) ; + } + + if ! $($(p)) + { + local files = [ Glob $(<:P) : * ] ; + $(p) = $(files:BS) ; + } + + if $(<:BS) in $($(p)) + { + if $(VERBOSE) >= 5 + { + Echo Found $(<:BS) ; + } + return 1 ; + } + + return ; +} + +if ! [ Exists $(DECB) ] +{ + Echo toolshed not found at path: $(TOOLSHED_PATH) ; +} + +if ! [ Exists $(LWASM) ] +{ + Echo lwtools not found at path: $(LWTOOLS_PATH) ; +} + +if [ Exists $(VCC) ] +{ + HAVE_VCC = vcc ; +} + +if [ Exists $(XROAR) ] +{ + HAVE_XROAR = xroar ; +} + +EMULATORS = VCC XROAR ; +HAVE_EMULATOR = $(HAVE_$(EMULATORS)) ; + +if ! $(HAVE_EMULATOR) +{ + Exit No emulator found at path: $(VCC) or $(XROAR) ; +} + +if $(VERBOSE) > 1 +{ + Echo Have emulators: $(HAVE_EMULATOR) ; +} + +rule Assembly +{ + local target = $(<:US=.BIN) ; + local listing = $(<:US=.LST) ; + MakeLocate $(listing) : $(LOCATE_TARGET) ; + Assemble $(target) : $(<) ; + NoCare $(listing) ; + LISTING on $(target) = $(listing) ; + Clean clean : $(listing) ; + return $(target) ; +} + +rule Assemble +{ + MakeLocate $(<) : $(LOCATE_TARGET) ; + Depends $(<) : $(>) ; + Clean clean : $(<) ; + Depends asm : $(<) ; + NotFile asm ; +} + +actions Assemble +{ + $(LWASM) --6809 --list=$(LISTING) --symbols --6800compat --output=$(<[1]:U) --format=decb $(>) +} + +rule DecbCopy +{ + Decb $(<) : $(>) ; +} + +rule Decb +{ + Depends $(<) : $(>) ; + Depends disk : $(<) ; + NotFile disk ; +} + +actions Decb +{ + $(DECB) copy -2 -b $(>) -r $(<),$(>:U) +} + +rule DecbCopyAll disk : files +{ + local file ; + for file in $(files:BS) + { + DecbCopy $(disk) : $(file) ; + } +} + +rule MakeDisk disk +{ + if ! $($(<)-mkdsk) + { + $(<)-mkdsk = true ; + MakeDisk1 $(<) ; + Clean clean : $(<) ; + Depends dsk : $(<) ; + } +} + +actions MakeDisk1 +{ + $(DECB) dskini -4 $(<) +} + +rule RunToolOn tool : binary : disk : disk2 +{ + local run = run-$(tool:L) run-$(SHORT:L) ; + NotFile $(run) ; + Always $(run) ; + + local run_target = $(SHORT:L)-$(binary:BL) ; + $(tool:U) on $(run_target) = $(tool:U) ; + $(tool) $(run_target) : $(binary:U) : $(disk) : $(disk2) ; +} + +rule RunTool tool : binary : disk : disk2 +{ + if $(HAVE_$(tool:U)) + { + on $(tool:L) RunToolOn $(tool) : $(binary) : $(disk) : $(disk2) ; + } +} + +rule Run binary : disk : extrafiles : disk2 +{ + MakeLocate $(disk) : $(LOCATE_TARGET) ; + MakeDisk $(disk) ; + + DecbCopyAll $(disk) : $(binary) $(extrafiles) ; + + RunTool Vcc : $(binary) : $(disk) : $(disk2) ; + RunTool XRoar : $(binary) : $(disk) : $(disk2) ; +} + +rule Vcc target : binary : disk : disk2 +{ + Depends $(<) : $(disk) ; + NotFile $(<) ; + Always $(<) ; + VCC on $(<) = $(VCC) ; +} + +actions ignore Vcc +{ + $(VCC) $(>) +} + +rule XRoar target : binary : disk : disk2 +{ + DISK on $(target) = $(disk) ; + Depends $(target) : $(disk) ; + if $(disk2) + { + DISK2 on $(target) = $(disk2) ; + Depends $(target) : $(disk2) ; + } + + Depends $(target) : $(disk) ; + NotFile $(target) ; + Always $(target) ; + XROAR on $(<) = $(XROAR) ; +} + +actions ignore XRoar bind DISK DISK2 +{ + $(XROAR) -m coco3p -tv-type ntsc -gdb -joy-right mjoy0 -load-fd0$(SPACE)$(DISK) -load-fd1$(SPACE)$(DISK2) -run $(>) +} + +rule Ball +{ + NotFile balls ; + Depends balls : $(<) ; + Depends $(<) : $(>) ; + switch $(<) + { + case *.tgz : Tarz $(<) : $(>) ; + case *.shar : Shar $(<) : $(>) ; + case *.zip : Zip $(<) : $(>) ; + } +} + +actions Tarz +{ + tar czvhf $(<) --transform 's,^,$(VERSION)/,' $(>) +} + +actions Tar +{ + tar cvhf $(<) --transform 's,^,$(VERSION)/,' $(>) +} + +actions Shar +{ + shar $(>) > $(<) +} + +actions Zip +{ + zip $(<) $(>) +} + + diff --git a/README.md b/README.md index 0ee8168..27a714a 100644 --- a/README.md +++ b/README.md @@ -13,22 +13,35 @@ interrupts being enabled can happen anywhere but in this test it should only occur at address 4090 and 4093. This test will tally up how many for each, typical results are TALLY = CA00008E as tested on a real CoCo3. +
+ +CoCo 3 - I3 + +CoCo 3 - Interrupt Test #3[^fa] + +
+ +[^fa]: Image provided by Ed Jaquay + ToDo: Test how often the wait loop while interrupts active in test #3 continue looping after interrupt has occurred, as this seems to affect the title screen of the game Contras. + ## Results | Machine | Version | #1 | #2 | #3 | | -------- | ------- | -- | -- | -- | -| CoCo 3 | - | Pass :heavy_check_mark: | Pass :heavy_check_mark: | Pass :heavy_check_mark: Tally = CA00008E | +| CoCo 3 | - | Pass :heavy_check_mark: | Pass :heavy_check_mark: | Pass :heavy_check_mark: Tally = CA00008E1 | | MAME coco3 | 0277b | Pass :heavy_check_mark: | Pass :heavy_check_mark: | Pass :heavy_check_mark: | | xroar coco3p | 1.5 | Pass :heavy_check_mark: | Pass :heavy_check_mark: | Pass :heavy_check_mark: Tally = B10000A7 | | xroar coco3p | 1.8.1 | Pass :heavy_check_mark: | Pass :heavy_check_mark: | Pass :heavy_check_mark: Tally = BD00009B | | VCC | <2.1.9.1 | No :x: | No :x: | No :x: Tally = 510000DB| | VCC | 2.1.9.2 | Pass :heavy_check_mark: | Pass :heavy_check_mark: | Pass :heavy_check_mark: Tally = 980000C0 | +| trs80gp2 | 2.5.4 | Pass :heavy_check_mark: | Pass :heavy_check_mark: | Pass :heavy_check_mark: Tally = B40000A4 | | Coco3FPGA | :grey_question: | :grey_question: | :grey_question: | :grey_question: | | RealCoco3 | :grey_question: | :grey_question: | :grey_question: | :grey_question: | -- Interestingly on test #3 a real CoCo 3 interrupts from address 4090 more often than 4093. +1. Interestingly on test #3 a real CoCo 3 interrupts from address 4090 more often than 4093. +2. Something is not quite right though because Dungeons of Daggorath zooms though the title screen as if its not vsync'ing and during game play sometimes skips forward very quickly. ## Building @@ -36,11 +49,15 @@ To build the dsk image require some tools... ### Requirements -- Jam 2.6.1 -- Toolshed 2.2 +- [Jam 2.6.1](https://github.com/callsop/perforce-jam) +- [Toolshed 2.4](https://github.com/nitros9project/toolshed) +- [Lwtools 4.24](http://www.lwtools.ca) #### Linux - WIP + +Assumes toolshed and xroar or vcc are installed to /usr/local/bin - if not edit the paths in Jamrules. Install Lwtools with my script ```setup/lwtools.sh``` that downloads and installs it. + +To install jam use apt: ``` sudo apt install jam @@ -48,18 +65,41 @@ sudo apt install jam #### Windows -Jam 2.6.1 is here: https://github.com/callsop/perforce-jam/releases/tag/v2.6.1 +Jam 2.6.1 is here: https://github.com/callsop/perforce-jam/releases/tag/v2.6.1 just extract it somewhere and add to the PATH. Download the latest Toolshed release from link above, mine is installed at c:\Programs\toolshed-2.4. Windows version of Lwtools needs to be built from source as its not available anywhere I could find at this time. ### Building .dsk image ``` -jam dsk +$ jam dsk +...found 18 target(s)... +...updating 5 target(s)... +Assemble I1.BIN +Assemble I2.BIN +Assemble I3.BIN +MakeDisk1 craigtst.dsk +Decb craigtst.dsk +Decb craigtst.dsk +Decb craigtst.dsk +Decb craigtst.dsk +Decb craigtst.dsk +Decb craigtst.dsk +Decb craigtst.dsk +Decb craigtst.dsk +Decb craigtst.dsk +Decb craigtst.dsk +Decb craigtst.dsk +Decb craigtst.dsk +...updated 5 target(s)... ``` ### Clean ``` -jam clean +$ jam clean +...found 2 target(s)... +...updating 1 target(s)... +Clean clean +...updated 1 target(s)... ``` ## Running @@ -86,3 +126,6 @@ Use the label v- and program name. ``` jam v-i1 ``` + + + diff --git a/decb.bat b/decb.bat index c7279e9..07aa88c 100644 --- a/decb.bat +++ b/decb.bat @@ -1 +1 @@ -c:\Programs\toolshed-2.2\decb.exe %* \ No newline at end of file +c:\Programs\toolshed-2.4\decb.exe %* \ No newline at end of file diff --git a/images/coco3test.png b/images/coco3test.png new file mode 100644 index 0000000..31937a3 Binary files /dev/null and b/images/coco3test.png differ diff --git a/setup/lwtools.patch b/setup/lwtools.patch new file mode 100644 index 0000000..8e02157 --- /dev/null +++ b/setup/lwtools.patch @@ -0,0 +1,24 @@ +diff --git a/lwasm/symbol.c b/lwasm/symbol.c +index dfd3ad3..fefc74a 100644 +--- a/lwasm/symbol.c ++++ b/lwasm/symbol.c +@@ -106,6 +106,9 @@ struct symtabe *register_symbol(asmstate_t *as, line_t *cl, char *sym, lw_expr_t + } + } + ++ if (*sym == '.') ++ islocal = 1; ++ + for (cp = sym; *cp; cp++) + { + if (*cp == '@' || *cp == '?') +@@ -254,6 +257,9 @@ struct symtabe * lookup_symbol(asmstate_t *as, line_t *cl, char *sym) + int cdir; + + debug_message(as, 100, "Look up symbol %s", sym); ++ ++ if (*sym == '.') ++ local = 1; + + // check if this is a local symbol + if (strchr(sym, '@') || strchr(sym, '?')) diff --git a/setup/lwtools.sh b/setup/lwtools.sh new file mode 100644 index 0000000..3e43807 --- /dev/null +++ b/setup/lwtools.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# +# Doesn't appear like there is a published package available +# at this time, so this will build it from source by downloading +# it, building and installing. +# +mkdir -p lwtools +cd lwtools +wget http://www.lwtools.ca/releases//lwtools/lwtools-4.24.tar.gz +tar xvf lwtools-4.24.tar.gz +cd lwtools-4.24/ +sudo patch -p1 < ../../setup/lwtools.patch +sudo make install \ No newline at end of file