From 62ba694100ac633c15dd4846c7b7c6094205aeee Mon Sep 17 00:00:00 2001 From: Jamie Cho Date: Sat, 6 Oct 2018 18:11:52 -0400 Subject: [PATCH 1/3] Update image tools, cmoc, os9 lib --- Dockerfile | 21 ++++++++++++-------- build | 2 +- coco-dev | 13 ++++++++++--- docker-compose.yml | 2 +- scripts/cm3toppm | 47 --------------------------------------------- scripts/mgetoppm | 48 ---------------------------------------------- 6 files changed, 25 insertions(+), 108 deletions(-) delete mode 100755 scripts/cm3toppm delete mode 100755 scripts/mgetoppm diff --git a/Dockerfile b/Dockerfile index 6c87ad8..05a80a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:16.04 -MAINTAINER Jamie Cho version: 0.8 +MAINTAINER Jamie Cho version: 0.10 # Setup sources RUN apt-get update && apt-get install -y \ @@ -38,13 +38,16 @@ RUN add-apt-repository ppa:tormodvolden/m6809 RUN echo deb http://ppa.launchpad.net/tormodvolden/m6809/ubuntu trusty main >> /etc/apt/sources.list.d/tormodvolden-m6809-trusty.list && \ echo deb http://ppa.launchpad.net/tormodvolden/m6809/ubuntu precise main >> /etc/apt/sources.list.d/tormodvolden-m6809-trusty.list RUN apt-get update && apt-get upgrade -y && apt-get install -y \ - cmoc=0.1.52-0~tormod \ + cmoc=0.1.53-0~tormod \ gcc6809=4.6.4-0~lw9a~trusty \ lwtools=4.15-0~tormod~trusty \ toolshed=2.2-0~tormod # Install CoCo image conversion scripts -COPY scripts/* /usr/local/bin/ +WORKDIR /root +RUN git config --global core.autocrlf input && \ + git clone https://github.com/jamieleecho/coco-tools.git && \ + (cd coco-tools && python setup.py install) # Install milliluk-tools WORKDIR /root @@ -52,13 +55,12 @@ RUN git config --global core.autocrlf input && \ git clone https://github.com/milliluk/milliluk-tools.git && \ (cd milliluk-tools && git checkout 454e7247c892f7153136b9e5e6b12aeeecc9dd36 && \ dos2unix < cgp220/cgp220.py > /usr/local/bin/cgp220.py && \ - dos2unix < max2png/max2png.py > /usr/local/bin/max2png.py) && \ - chmod a+x /usr/local/bin/cgp220.py /usr/local/bin/max2png.py + chmod a+x /usr/local/bin/cgp220.py) # Install boisy/cmoc_os9 RUN git clone https://github.com/tlindner/cmoc_os9.git WORKDIR cmoc_os9/lib -RUN git checkout f843083a3c260d51d8ca118eca0565a50530a36f && \ +RUN git checkout 9f9dfda1406d152f137131f0670c94d105b9b072 && \ make WORKDIR ../cgfx RUN make @@ -74,12 +76,15 @@ WORKDIR .. RUN git clone https://github.com/mikeakohn/naken_asm.git && \ git clone https://github.com/mikeakohn/java_grinder WORKDIR naken_asm -RUN git checkout 79d8eb05b77f23f4225282f635c9ee8ec9398ca6 && \ +RUN git checkout 201acd7885bd6e31d5ca7001d6aa643b911913f3 && \ ./configure && make && make install WORKDIR ../java_grinder -RUN git checkout 7d5e279c8b52c99414ded785b0ef8065dead55eb && \ +RUN git checkout ae67d7c11bc94059b1d15c6b18eca06975ec92c0 && \ make && cp java_grinder /usr/local/bin/ WORKDIR .. # Clean up RUN apt-get clean + +# Convenience for Mac users +RUN ln -s /home /Users diff --git a/build b/build index 7d5c47e..b57b813 100755 --- a/build +++ b/build @@ -1,5 +1,5 @@ #!/usr/bin/env bash docker-compose -f docker-compose.build.yml build -docker tag coco-dev_coco-dev:latest jamieleecho/coco-dev:0.9 +docker tag coco-dev_coco-dev:latest jamieleecho/coco-dev:0.10 diff --git a/coco-dev b/coco-dev index 4fd79b0..bb60de7 100755 --- a/coco-dev +++ b/coco-dev @@ -1,13 +1,20 @@ - #!/usr/bin/env sh +#!/usr/bin/env sh + + +if [[ $* = *[!\ ]* ]]; then + params=( -c "$*" ) +else + params=() +fi case "$(uname -s)" in Darwin) - docker-compose -f docker-compose.yml run --rm -w /home/$USER coco-dev bash + docker-compose -f docker-compose.yml run --rm -w `pwd | sed -e s#^/[Uu][Ss][Ee][Rr][Ss]#/home#` coco-dev bash "${params[@]}" ;; Linux) - docker-compose -f docker-compose.yml run --rm -w /home/$USER coco-dev bash + docker-compose -f docker-compose.yml run --rm -w `pwd | sed -e s#^/[Uu][Ss][Ee][Rr][Ss]#/home#` coco-dev bash "${params[@]}" ;; CYGWIN*|MINGW32*|MSYS*) diff --git a/docker-compose.yml b/docker-compose.yml index d1e7756..765843d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: coco-dev: - image: jamieleecho/coco-dev:0.9 + image: jamieleecho/coco-dev:0.10 environment: - HOME=/home/$USER volumes: diff --git a/scripts/cm3toppm b/scripts/cm3toppm deleted file mode 100755 index dd33a91..0000000 --- a/scripts/cm3toppm +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env ruby -# encoding: utf-8 -# cm3toppm - decoder for cm3 (CoCoMax 3) format -# Copyright (c) 2017 by Mathieu Bouchard -# reads cm3 from stdin, outputs ppm that can be piped -# to cjpeg (.jpg) from jpeg-tools, or to pnmtopng (.png) from netpbm. - -def debug(x) STDERR.puts x end -def dump(x) c=$palette[x]; STDOUT.write [(c[5]*2+c[2])*85,(c[4]*2+c[1])*85,(c[3]*2+c[0])*85].pack("ccc") end -f=STDIN; f.set_encoding("ASCII-8BIT") -cols=320; pictyp=f.read(1).ord; rows=(pictyp[7]+1)*192; sans_motifs=pictyp[0]!=0 -debug "#{cols}x#{rows}, 16 couleurs, sans_motifs=#{sans_motifs}" -$palette=[]; 16.times {$palette<=128; a = f.read(1).ord - else - cc=buff1[u][bitu]; bitu-=1; if bitu<0; bitu=7; u+=1 end - if cc==0; a=linbuf[(x-1)%160] - else - cc=buff2[y][bity]; bity-=1; if bity<0; bity=7; y+=1 end - if cc==0; a=linbuf[x] else a=f.read(1).ord end - end - end - linbuf[x]=a; dump a>>4; dump a&15; x+=1 - } - } -} -extra=0; extra+=1 while f.read(1); debug "#{extra} octets de trop" if extra>0 diff --git a/scripts/mgetoppm b/scripts/mgetoppm deleted file mode 100755 index d92aeb6..0000000 --- a/scripts/mgetoppm +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env ruby -# encoding: utf-8 -# mgetoppm - decoder for mge (ColorMax 3) format -# Copyright (c) 2017 by Mathieu Bouchard -# reads mge from stdin, outputs ppm that can be piped -# to cjpeg (.jpg) from jpeg-tools, or to pnmtopng (.png) from netpbm. - -$px=$py=0 -def debug(x) STDERR.puts x end -def dmp500(x) - c=$palette[x]; STDOUT.write [(c[5]*2+c[2])*85,(c[4]*2+c[1])*85,(c[3]*2+c[0])*85].pack("ccc") -end -c2r=[0,21,2,20,6,49,35,4,33,5,14,1,12,10,3,28, -7,17,16,22,48,34,37,32,44,40,42,13,8,11,24,26, -56,19,18,50,54,52,38,36,46,45,41,15,9,25,27,30, -63,58,23,51,55,53,39,60,47,61,43,57,29,31,59,62] -f=STDIN; f.set_encoding("ASCII-8BIT") -subtyp=0; $cols=320<>4; dmp500 a&0x0F end -else - def dump a; dmp500 a>>6; dmp500 (a>>4)&3; dmp500 (a>>2)&3; dmp500 a&3 end -end -cycles=f.read(1).ord -a=f.read(1).ord; botpal=a&0xF; toppal=(a>>4)&0xF -debug "#{$cols}x#{rows}, 16 couleurs #{colorspace}, titre «#{titbuf}»" -debug "palette=#{$palette.inspect}, cycles=#{cycles}, botpal=#{botpal}, -toppal=#{toppal}" -puts "P6\n#{$cols} #{rows}\n255" -y=160*rows -if not packed - loop { - b=f.read(1).ord - break if b==0 - a=f.read(1).ord - b.times {dump a; y-=1; break if y<=0} - break if y<=0 - } -else - y.times {dump f.read(1).ord} -end -extra=0; extra+=1 while f.read(1); debug "#{extra} octets de trop" if extra>0 From 545c3555e1b7dbe735dce4fe398fd44895fb6d69 Mon Sep 17 00:00:00 2001 From: Jamie Cho Date: Sat, 6 Oct 2018 18:15:06 -0400 Subject: [PATCH 2/3] Update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ca7f158..f0439c9 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ Color Computer](https://en.wikipedia.org/wiki/TRS-80_Color_Computer) applications. It implements a Docker image that includes the following tools: * [LWTOOLS 4.15](http://lwtools.projects.l-w.ca) * [ToolShed 2.2](https://sourceforge.net/p/toolshed/wiki/Home/) -* [CMOC 0.1.52](http://perso.b2b2c.ca/~sarrazip/dev/cmoc.html) +* [CMOC 0.1.53](http://perso.b2b2c.ca/~sarrazip/dev/cmoc.html) * [gcc6809](https://launchpad.net/~tormodvolden/+archive/ubuntu/m6809) * [MAME Tools](https://packages.ubuntu.com/xenial/utils/mame-tools) * [milliluk-tools](https://github.com/milliluk/milliluk-tools) * [tlinder/cmoc\_os9](https://github.com/tlinder/cmoc_os9) * [Java Grinder](http://www.mikekohn.net/micro/java_grinder.php) * [naken](http://www.mikekohn.net/micro/naken_asm.php) -* Image conversion scripts by Mathieu Bouchard +* [coco-tools](https://github.com/jamieleecho/coco-tools) * Python and Ruby as well as some useful Python packages From b8fd84947c967c8ea75cd74b5e1e6b355b80f339 Mon Sep 17 00:00:00 2001 From: Jamie Cho Date: Sat, 6 Oct 2018 18:16:45 -0400 Subject: [PATCH 3/3] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0439c9..c86a590 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ applications. It implements a Docker image that includes the following tools: * [tlinder/cmoc\_os9](https://github.com/tlinder/cmoc_os9) * [Java Grinder](http://www.mikekohn.net/micro/java_grinder.php) * [naken](http://www.mikekohn.net/micro/naken_asm.php) -* [coco-tools](https://github.com/jamieleecho/coco-tools) +* [coco-tools 0.2](https://github.com/jamieleecho/coco-tools) * Python and Ruby as well as some useful Python packages