mirror of https://github.com/datajerk/c2d.git
Compare commits
7 Commits
e690a1c022
...
6105800884
Author | SHA1 | Date |
---|---|---|
Egan Ford | 6105800884 | |
Egan Ford | a64e5a176b | |
Egan Ford | ced20889ab | |
Egan Ford | e6e2c9b15a | |
Egan Ford | 51933f3223 | |
Egan Ford | 163d8a9661 | |
Egan Ford | e0d9e2a3ca |
|
@ -0,0 +1,12 @@
|
|||
# docker build --no-cache -t wine32 -f Dockerfile.wine32 .
|
||||
FROM ubuntu:19.10
|
||||
|
||||
ENV LC_CTYPE C.UTF-8
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN dpkg --add-architecture i386
|
||||
RUN apt-get update
|
||||
RUN apt-get -qy install wine32
|
||||
|
||||
WORKDIR /root
|
||||
RUN wine foobar || true
|
57
Makefile
57
Makefile
|
@ -8,32 +8,63 @@ windows: bin/c2d.exe bin/text2page.exe bin/page2text.exe
|
|||
|
||||
dist: all windows
|
||||
|
||||
c2d.h: c2d.h.0 asm/loader.s asm/bar.s makeheader
|
||||
cc65-sources-2.13.3.tar.bz2:
|
||||
curl -sLO https://github.com/mrdudz/cc65-old/raw/master/cc65-sources-2.13.3.tar.bz2
|
||||
|
||||
cc65-2.13.3/bin/cl65: cc65-sources-2.13.3.tar.bz2
|
||||
tar zxf cc65-sources-2.13.3.tar.bz2
|
||||
(cd cc65-2.13.3; /usr/bin/sed 's!/usr/local!'${PWD}'/cc65-2.13.3!' <make/gcc.mak >Makefile; make -j4 bins || make bins && make install || true)
|
||||
|
||||
c2d.h: c2d.h.0 asm/loader.s asm/bar.s makeheader cc65-2.13.3/bin/cl65
|
||||
./makeheader
|
||||
|
||||
bin/c2d: c2d.c c2d.h
|
||||
gcc -Wall -Wno-missing-braces -I. -O3 -o $@ $< -lm
|
||||
bin/c2d_arm: c2d.c c2d.h
|
||||
gcc -Wall -Wno-missing-braces -I. -O3 -target arm64-apple-macos11 -o $@ $< -lm
|
||||
|
||||
bin/text2page_arm: text2page.c
|
||||
gcc -Wall -O3 -target arm64-apple-macos11 -o $@ $< -lm
|
||||
|
||||
bin/page2text_arm: page2text.c
|
||||
gcc -Wall -O3 -target arm64-apple-macos11 -o $@ $< -lm
|
||||
|
||||
bin/mandelbrotgr_arm: mandelbrotgr.c
|
||||
gcc -Wall -O3 -target arm64-apple-macos11 -o $@ $< -lm
|
||||
|
||||
bin/c2d_x86: c2d.c c2d.h
|
||||
gcc -Wall -Wno-missing-braces -I. -O3 -target x86_64-apple-macos10.12 -o $@ $< -lm
|
||||
|
||||
bin/text2page_x86: text2page.c
|
||||
gcc -Wall -O3 -target -x86_64-apple-macos10.12 -o $@ $< -lm
|
||||
|
||||
bin/page2text_x86: page2text.c
|
||||
gcc -Wall -O3 -target x86_64-apple-macos10.12 -o $@ $< -lm
|
||||
|
||||
bin/mandelbrotgr_x86: mandelbrotgr.c
|
||||
gcc -Wall -O3 -target x86_64-apple-macos10.12 -o $@ $< -lm
|
||||
|
||||
bin/c2d: bin/c2d_x86 bin/c2d_arm
|
||||
lipo -create -output $@ $<
|
||||
|
||||
bin/text2page: bin/text2page_x86 bin/text2page_arm
|
||||
lipo -create -output $@ $<
|
||||
|
||||
bin/page2text: bin/page2text_x86 bin/page2text_arm
|
||||
lipo -create -output $@ $<
|
||||
|
||||
bin/mandelbrotgr: bin/mandelbrotgr_x86 bin/mandelbrotgr_arm
|
||||
lipo -create -output $@ $<
|
||||
|
||||
bin/c2d.exe: c2d.c c2d.h
|
||||
$(WIN32GCC) -Wall -Wno-missing-braces -I. -O3 -o $@ $<
|
||||
|
||||
bin/text2page: text2page.c
|
||||
gcc -Wall -O3 -o $@ $< -lm
|
||||
|
||||
bin/text2page.exe: text2page.c
|
||||
$(WIN32GCC) -Wall -O3 -o $@ $<
|
||||
|
||||
bin/page2text: page2text.c
|
||||
gcc -Wall -O3 -o $@ $< -lm
|
||||
|
||||
bin/page2text.exe: page2text.c
|
||||
$(WIN32GCC) -Wall -O3 -o $@ $<
|
||||
|
||||
bin/mandelbrotgr: mandelbrotgr.c
|
||||
gcc -Wall -O3 -o $@ $< -lm
|
||||
|
||||
clean:
|
||||
rm -f bin/* *.dsk c2d.h c2d.h.1
|
||||
rm -rf bin/* *.dsk c2d.h c2d.h.1 cc65-sources-2.13.3.tar.bz2 cc65-2.13.3
|
||||
(cd asm; make clean)
|
||||
|
||||
gameserverclient.text: Makefile
|
||||
|
|
|
@ -31,6 +31,9 @@ Download <https://github.com/datajerk/c2d/archive/master.zip> and extract.
|
|||
|
||||
### Build Notes
|
||||
|
||||
NOTE: cc65 2.13.3 required (no other version supported)
|
||||
NOTE: Docker required for `make disttest`; run this once first `docker build --no-cache -t wine32 -f Dockerfile.wine32 .`
|
||||
|
||||
Unix/Linux:
|
||||
|
||||
make
|
||||
|
|
14
asm/Makefile
14
asm/Makefile
|
@ -1,9 +1,6 @@
|
|||
|
||||
CL = cl65
|
||||
CL_FLAGS = -t none --listing --list-bytes 100
|
||||
#CL_FLAGS = -t apple1 -C apple1-16k.cfg --listing --list-bytes 100
|
||||
CC = cl65
|
||||
CC_FLAGS = --static-locals -t apple1 -C apple1-16k.cfg
|
||||
C2T = c2t
|
||||
|
||||
ASRC = $(shell echo *.s)
|
||||
AOBJ = $(ASRC:%.s=%.o)
|
||||
|
@ -17,11 +14,4 @@ clean:
|
|||
-rm -f $(ABIN) $(AOBJ) $(ALST) $(AMON)
|
||||
|
||||
%: %.s
|
||||
$(CL) $(CL_FLAGS) $<
|
||||
|
||||
%: %.c
|
||||
$(CC) $(CC_FLAGS) $<
|
||||
|
||||
%.mon: %
|
||||
$(C2T) $< $@
|
||||
|
||||
$(CL) $(CL_FLAGS) $<
|
||||
|
|
BIN
bin/c2d.exe
BIN
bin/c2d.exe
Binary file not shown.
BIN
bin/page2text
BIN
bin/page2text
Binary file not shown.
Binary file not shown.
BIN
bin/text2page
BIN
bin/text2page
Binary file not shown.
Binary file not shown.
3
c2d.c
3
c2d.c
|
@ -336,7 +336,8 @@ char *getext(char *filename)
|
|||
if (sp == strlen(filename) || sp == 0)
|
||||
return (NULL);
|
||||
|
||||
if ((rval = (char *) malloc(sp * sizeof(char))) == NULL); //do error code
|
||||
if ((rval = (char *) malloc(sp * sizeof(char))) == NULL)
|
||||
; //do error code
|
||||
|
||||
rval[sp] = '\0';
|
||||
for (i = 0; i < sp + i; i++)
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
docker run --rm -it -v $PWD:/pwd wine32 bash -c "cd /pwd && wine $*"
|
Binary file not shown.
Binary file not shown.
45
makeheader
45
makeheader
|
@ -1,44 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
header()
|
||||
{
|
||||
FILE=$1
|
||||
VAR=$2
|
||||
EOL=$3
|
||||
BYTES=$(hexdump -v $FILE | sed 's/^.......//' | wc -w | awk '{print $1}');
|
||||
|
||||
echo "/*"
|
||||
expand ${FILE}.s
|
||||
echo "*/"
|
||||
|
||||
printf "unsigned char $VAR[] = {\n\t"
|
||||
|
||||
for i in $(hexdump -v $FILE | sed 's/^.......//');
|
||||
do
|
||||
printf "0x%02X" 0x$i
|
||||
BYTES=$((BYTES - 1))
|
||||
if ((BYTES != 0))
|
||||
then
|
||||
printf ","
|
||||
fi
|
||||
EOL=$((EOL - 1))
|
||||
if ((EOL == 0))
|
||||
then
|
||||
EOL=8
|
||||
printf "\n\t"
|
||||
fi
|
||||
done
|
||||
|
||||
printf "\n};\n"
|
||||
}
|
||||
|
||||
cd asm
|
||||
make clean
|
||||
make
|
||||
PATH=../cc65-2.13.3/bin:$PATH make
|
||||
|
||||
(
|
||||
header loader loadercode 8
|
||||
header bar barcode 8
|
||||
echo "/*"
|
||||
expand loader.s
|
||||
echo "*/"
|
||||
/usr/bin/xxd -i loader | sed 's/loader/loadercode/'
|
||||
|
||||
echo "/*"
|
||||
expand bar.s
|
||||
echo "*/"
|
||||
/usr/bin/xxd -i bar | sed 's/bar/barcode/'
|
||||
) > ../c2d.h.1
|
||||
|
||||
cd ..
|
||||
|
|
|
@ -17,7 +17,7 @@ on run argv
|
|||
set theMachine to (make new AppleIIe)
|
||||
tell theMachine
|
||||
-- Change to a color screen
|
||||
-- set monochrome screen to false
|
||||
set monochrome screen to false
|
||||
set scanlines to true
|
||||
set speaker volume to 0.25
|
||||
insert my_path & my_disk into device "S6D1"
|
||||
|
|
28
test.sh
28
test.sh
|
@ -47,9 +47,8 @@ then
|
|||
echo
|
||||
echo "Testing Windows c2d..."
|
||||
echo
|
||||
PATH=$HOME/wine/bin:$PATH
|
||||
echo "wine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk"
|
||||
wine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk 2>&1 | sed 's/^/ /'
|
||||
echo "./dwine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk"
|
||||
./dwine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk 2>&1 | sed 's/^/ /'
|
||||
CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}')
|
||||
if [ "$CHECK" = "$SUM" ]
|
||||
then
|
||||
|
@ -104,11 +103,10 @@ then
|
|||
echo
|
||||
echo "Testing Windows c2d textpage..."
|
||||
echo
|
||||
PATH=$HOME/wine/bin:$PATH
|
||||
echo "wine bin/text2page.exe <${BIN}.text >${BIN}.textpage"
|
||||
wine bin/text2page.exe <${BIN}.text >${BIN}.textpage
|
||||
echo "wine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk"
|
||||
wine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk 2>&1 | sed 's/^/ /'
|
||||
echo "./dwine bin/text2page.exe <${BIN}.text >${BIN}.textpage"
|
||||
./dwine bin/text2page.exe '<'${BIN}.text '>'${BIN}.textpage
|
||||
echo "./dwine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk"
|
||||
./dwine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk 2>&1 | sed 's/^/ /'
|
||||
CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}')
|
||||
if [ "$CHECK" = "$SUM" ]
|
||||
then
|
||||
|
@ -145,9 +143,8 @@ rm -f ${BIN}.dsk
|
|||
echo
|
||||
echo "Testing Windows c2d..."
|
||||
echo
|
||||
PATH=$HOME/wine/bin:$PATH
|
||||
echo "wine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk"
|
||||
wine bin/c2d.exe ${MON} ${BIN}.dsk 2>&1 | sed 's/^/ /'
|
||||
echo "./dwine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk"
|
||||
./dwine bin/c2d.exe ${MON} ${BIN}.dsk 2>&1 | sed 's/^/ /'
|
||||
CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}')
|
||||
if [ "$CHECK" = "$SUM" ]
|
||||
then
|
||||
|
@ -183,11 +180,10 @@ then
|
|||
echo
|
||||
echo "Testing Windows c2d textpage..."
|
||||
echo
|
||||
PATH=$HOME/wine/bin:$PATH
|
||||
echo "wine bin/text2page.exe <${BIN}.text >${BIN}.textpage"
|
||||
wine bin/text2page.exe <${BIN}.text >${BIN}.textpage
|
||||
echo "wine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk"
|
||||
wine bin/c2d.exe -t ${BIN}.textpage ${MON} ${BIN}.dsk 2>&1 | sed 's/^/ /'
|
||||
echo "./dwine bin/text2page.exe <${BIN}.text >${BIN}.textpage"
|
||||
./dwine bin/text2page.exe '<'${BIN}.text '>'${BIN}.textpage
|
||||
echo "./dwine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk"
|
||||
./dwine bin/c2d.exe -t ${BIN}.textpage ${MON} ${BIN}.dsk 2>&1 | sed 's/^/ /'
|
||||
CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}')
|
||||
if [ "$CHECK" = "$SUM" ]
|
||||
then
|
||||
|
|
Loading…
Reference in New Issue