remove orig files from 2005/sykes
We also download the files needed to form the pet.rom file.
This commit is contained in:
1 parent
02214f94c2
commit
da4c284f1f
10 files changed
+344
-104
No files matched your search
@@ -0,0 +1,2 @@
|
||||
pet.rom
|
||||
sykes
|
||||
+321
-23
@@ -1,38 +1,336 @@
|
||||
LDFLAGS+=-lcurses
|
||||
#!/usr/bin/env make
|
||||
#
|
||||
# IOCCC 2005 winning entry - sykes
|
||||
|
||||
build: sykes
|
||||
################################################################################
|
||||
#
|
||||
# Regarding individual entries:
|
||||
#
|
||||
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||
# conditions and build environments change, especially when it comes to more
|
||||
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||
# later IOCCC years.
|
||||
#
|
||||
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||
#
|
||||
# GitHub pull requests are welcome:
|
||||
#
|
||||
# If you have a patch that might make running an entry work in modern Unix-like
|
||||
# environments, please create a GitHub pull request for the IOCCC judges to
|
||||
# consider.
|
||||
#
|
||||
# Suggestions and corrections regarding Makefiles, winning author information,
|
||||
# fixing typos in remarks, and code patches are welcome via opening a GitHub
|
||||
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
|
||||
# to consider. To form a GitHub issue or GitHub pull, please visit:
|
||||
#
|
||||
# https://github.com/ioccc-src/winner
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||
#
|
||||
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||
#
|
||||
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
|
||||
#############################
|
||||
# shell used by this Makefile
|
||||
#############################
|
||||
#
|
||||
SHELL= bash
|
||||
|
||||
#######################
|
||||
# common tool locations
|
||||
#######################
|
||||
#
|
||||
include ../../var.mk
|
||||
|
||||
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||
#
|
||||
#X11_LIBDIR= /usr/X11R6/lib
|
||||
#X11_LIBDIR= /usr/X11/lib
|
||||
X11_LIBDIR= /opt/X11/lib
|
||||
|
||||
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||
#
|
||||
#X11_INCDIR= /usr/X11R6/include
|
||||
#X11_INCDIR= /usr/X11/include
|
||||
X11_INCDIR= /opt/X11/include
|
||||
|
||||
# Common C compiler warnings to silence
|
||||
#
|
||||
#CSILENCE=
|
||||
CSILENCE= -Wno-bitwise-op-parentheses -Wno-empty-body -Wno-error \
|
||||
-Wno-implicit-function-declaration -Wno-implicit-int -Wno-parentheses \
|
||||
-Wno-pointer-sign -Wno-return-type
|
||||
|
||||
# Common C compiler warning flags
|
||||
#
|
||||
#CWARN= ${CSILENCE}
|
||||
#CWARN= -Wall ${CSILENCE}
|
||||
CWARN= -Wall -Wextra ${CSILENCE}
|
||||
#CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||
|
||||
# Compiler standard
|
||||
#
|
||||
#CSTD=
|
||||
#CSTD= -ansi
|
||||
CSTD= -std=gnu99
|
||||
|
||||
# Compiler bit architecture
|
||||
#
|
||||
# Some entries require 32-bitness:
|
||||
# ARCH= -m32
|
||||
#
|
||||
# Some entries require 64-bitness:
|
||||
# ARCH= -m64
|
||||
#
|
||||
# By default we assume nothing:
|
||||
#
|
||||
ARCH=
|
||||
|
||||
# Defines that are needed to compile
|
||||
#
|
||||
CDEFINE=
|
||||
#CDEFINE= -DIOCCC
|
||||
|
||||
# Include files that are needed to compile
|
||||
#
|
||||
CINCLUDE=
|
||||
#CINCLUDE= -include stdlib.h
|
||||
#CINCLUDE= -include stdio.h
|
||||
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||
#CINCLUDE= -I ${X11_INCDIR}
|
||||
#CINCLUDE= `${SDL2_CONFIG} --cflags`
|
||||
|
||||
# Optimization
|
||||
#
|
||||
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||
# A few compilers have broken optimizers or this entry make break
|
||||
# under those buggy optimizers and thus you may not want anything.
|
||||
# Reasonable compilers will allow for -O3.
|
||||
#
|
||||
#OPT=
|
||||
#OPT= -O
|
||||
#OPT= -O1
|
||||
#OPT= -O2
|
||||
OPT= -O3
|
||||
|
||||
# Default flags for ANSI C compilation
|
||||
#
|
||||
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
||||
|
||||
# Libraries needed to build
|
||||
#
|
||||
#LIBS=
|
||||
LIBS= -lcurses
|
||||
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||
#LIBS= `${SDL2_CONFIG} --libs`
|
||||
|
||||
# C compiler to use
|
||||
#
|
||||
CC= cc
|
||||
#CC=clang
|
||||
#CC=gcc
|
||||
|
||||
# Compiler add-ons or replacements for clang only
|
||||
#
|
||||
ifeq ($(CC),clang)
|
||||
#
|
||||
CSILENCE+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-prototypes \
|
||||
-Wno-missing-variable-declarations -Wno-pedantic \
|
||||
-Wno-poison-system-directories -Wno-shadow -Wno-shorten-64-to-32 \
|
||||
-Wno-strict-prototypes
|
||||
#
|
||||
CWARN+= -Weverything
|
||||
#
|
||||
endif
|
||||
|
||||
# Specific add-ons or replacements for gcc only
|
||||
#
|
||||
ifeq ($(CC),gcc)
|
||||
#
|
||||
#CSILENCE+=
|
||||
#
|
||||
#CWARN+=
|
||||
#
|
||||
endif
|
||||
|
||||
|
||||
##############################
|
||||
# Special flags for this entry
|
||||
##############################
|
||||
#
|
||||
ENTRY= sykes
|
||||
PROG= ${ENTRY}
|
||||
#
|
||||
OBJ= ${PROG}.o
|
||||
ROM_DATA= basic-2-c000.901465-01.bin basic-2-d000.901465-02.bin edit-2-n.901447-24.bin \
|
||||
nullfill.bin kernal-2.901465-03.bin
|
||||
DATA= ${ROM_DATA} 6502test DEMO chess
|
||||
TARGET= pet.rom ${PROG}
|
||||
#
|
||||
ALT_OBJ=
|
||||
ALT_TARGET=
|
||||
|
||||
|
||||
#################
|
||||
# build the entry
|
||||
#################
|
||||
#
|
||||
all: data ${TARGET}
|
||||
@${TRUE}
|
||||
|
||||
.PHONY: all alt data everything clean clobber install \
|
||||
love haste waste maker easter_egg sandwich \
|
||||
supernova deep_magic magic charon pluto
|
||||
|
||||
${PROG}: ${PROG}.c
|
||||
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||
|
||||
# alternative executable
|
||||
#
|
||||
alt: data ${ALT_TARGET}
|
||||
@${TRUE}
|
||||
|
||||
# data files
|
||||
#
|
||||
data: ${DATA}
|
||||
@${TRUE}
|
||||
|
||||
pet.rom: ${ROM_DATA}
|
||||
${RM} -f $@
|
||||
${CAT} ${ROM_DATA} > $@
|
||||
|
||||
# both all and alt
|
||||
#
|
||||
everything: all alt
|
||||
|
||||
|
||||
###############
|
||||
# utility rules
|
||||
###############
|
||||
#
|
||||
clean:
|
||||
-rm *.bin
|
||||
${RM} -f ${OBJ} ${ALT_OBJ}
|
||||
@-if [ -f indent.c ]; then \
|
||||
echo ${RM} -f indent.c; \
|
||||
${RM} -f indent.c; \
|
||||
fi
|
||||
|
||||
clobber: clean
|
||||
-rm sykes pet.rom
|
||||
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||
@-if [ -e sandwich ]; then \
|
||||
${RM} -f sandwich; \
|
||||
echo 'ate sandwich'; \
|
||||
fi
|
||||
|
||||
sykes: sykes.c
|
||||
${CC} ${CFLAGS} ${LDFLAGS} $< -o $@
|
||||
install:
|
||||
@echo "Dr. Spock says that is not logical!"
|
||||
@${TRUE}
|
||||
|
||||
alt: sykes.orig
|
||||
|
||||
sykes.orig: sykes.orig.c
|
||||
${CC} ${CFLAGS} ${LDFLAGS} $< -o $@
|
||||
# you may be able to misunderstand the source by reading indent.c
|
||||
#
|
||||
indent.c: ${PROG}.c
|
||||
@if which "${GINDENT}" >/dev/null 2>&1; then \
|
||||
echo ${RM} -f $@; \
|
||||
${RM} -f $@; \
|
||||
echo "${GINDENT} < $< > $@"; \
|
||||
${GINDENT} < $< > $@; \
|
||||
elif which "${INDENT}" >/dev/null 2>&1; then \
|
||||
echo ${RM} -f $@; \
|
||||
${RM} -f $@; \
|
||||
echo "${INDENT} < $< > $@"; \
|
||||
${INDENT} < $< > $@; \
|
||||
else \
|
||||
echo "no intent tool found, ident $< yourself, sorry"; \
|
||||
echo "exit 1"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
data: pet.rom
|
||||
|
||||
pet.rom: basic-2-c000.901465-01.bin basic-2-d000.901465-02.bin edit-2-n.901447-24.bin nullfill.bin kernal-2.901465-03.bin
|
||||
cat basic-2-c000.901465-01.bin basic-2-d000.901465-02.bin edit-2-n.901447-24.bin nullfill.bin kernal-2.901465-03.bin >pet.rom
|
||||
##################
|
||||
# 133t hacker rulz
|
||||
##################
|
||||
#
|
||||
love:
|
||||
@echo 'not war?'
|
||||
@${TRUE}
|
||||
|
||||
basic-2-c000.901465-01.bin:
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-c000.901465-01.bin
|
||||
haste:
|
||||
$(MAKE) waste
|
||||
@${TRUE}
|
||||
|
||||
basic-2-d000.901465-02.bin:
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-d000.901465-02.bin
|
||||
waste:
|
||||
@echo 'haste'
|
||||
@${TRUE}
|
||||
|
||||
edit-2-n.901447-24.bin:
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/edit-2-n.901447-24.bin
|
||||
maker:
|
||||
@echo 'Participate in a maker faire'
|
||||
@${TRUE}
|
||||
|
||||
kernal-2.901465-03.bin:
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/kernal-2.901465-03.bin
|
||||
easter_egg:
|
||||
@echo "you expected to often misunderstand this $${RANDOM} magic"
|
||||
@echo "chongo '<was here>' /\\oo/\\"
|
||||
@echo "Eggy"
|
||||
|
||||
nullfill.bin:
|
||||
dd bs=2k count=1 if=/dev/zero of=nullfill.bin
|
||||
sandwich: easter_egg
|
||||
@if [ `id -u` -eq 0 ]; then \
|
||||
echo 'Okay.'; \
|
||||
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
|
||||
else \
|
||||
echo 'What? Make it yourself.'; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# Understand the history of the Homebrew Computer Club
|
||||
# as well as the West Coast Computer Faire and
|
||||
# you might be confused different. :-)
|
||||
#
|
||||
supernova: sandwich
|
||||
@-if [ -r .code_anal ]; then \
|
||||
${RM} -f .code_anal_v6; \
|
||||
else \
|
||||
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
|
||||
fi
|
||||
@echo "A $@ helps ${MAKE} the elements that help form planets"
|
||||
@${TRUE}
|
||||
|
||||
deep_magic: supernova
|
||||
@-if [ -r .code_anal ]; then \
|
||||
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
|
||||
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
|
||||
else \
|
||||
echo "Wrong! Do it again!"; \
|
||||
sleep 2; \
|
||||
echo "Wrong! Do it again!"; \
|
||||
sleep 2; \
|
||||
echo "Wrong! Do it again!"; \
|
||||
fi
|
||||
@${TRUE}
|
||||
|
||||
magic: deep_magic
|
||||
@-if [ -r .code_anal ]; then \
|
||||
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
|
||||
else \
|
||||
echo "If you don't eat yer meat, you can't have any pudding!"; \
|
||||
echo "How can you have any pudding if you don't eat yer meat?!"; \
|
||||
fi
|
||||
@${TRUE}
|
||||
|
||||
# The IOCCC resident astronomer states
|
||||
#
|
||||
charon: magic
|
||||
@echo "$@ is a dwarf planet"
|
||||
@echo "dwarf is a type of planet"
|
||||
@echo "therefore IAU, $@ is a planet"
|
||||
|
||||
pluto: charon
|
||||
${MAKE} charon
|
||||
@echo "$@ is a dwarf planet"
|
||||
@echo "dwarf is a type of planet"
|
||||
@echo "therefore, $@ is a planet"
|
||||
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
|
||||
+21
-15
@@ -7,6 +7,18 @@ Laivalahdenportti 2
|
||||
Finland
|
||||
sds@maxisat.fi
|
||||
|
||||
## To build:
|
||||
|
||||
make all
|
||||
|
||||
### To run
|
||||
|
||||
./sykes binary_file
|
||||
|
||||
### Try:
|
||||
|
||||
./sykes pet.rom
|
||||
|
||||
## Judges' comments
|
||||
|
||||
For those who fondly remember their first PET, this entry will start you
|
||||
@@ -15,25 +27,19 @@ down memory lane ... starting with $C000 of course!
|
||||
We encourage you to try and grok the obfuscated expression on line 56,
|
||||
after C pre-processor gets finished with it!
|
||||
|
||||
You will need to download the ROM contents to use the emulator in PET
|
||||
mode.
|
||||
We download the ROM contents to use the emulator in PET mode as follows:
|
||||
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-c000.901465-01.bin
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-d000.901465-02.bin
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/edit-2-n.901447-24.bin
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/kernal-2.901465-03.bin
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-c000.901465-01.bin
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-d000.901465-02.bin
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/edit-2-n.901447-24.bin
|
||||
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/kernal-2.901465-03.bin
|
||||
|
||||
dd bs=2k count=1 if=/dev/zero of=nullfill.bin
|
||||
We then created:
|
||||
|
||||
cat basic-2-c000.901465-01.bin basic-2-d000.901465-02.bin edit-2-n.901447-24.bin nullfill.bin kernal-2.901465-03.bin >pet.rom
|
||||
dd bs=2k count=1 if=/dev/zero of=nullfill.bin
|
||||
|
||||
### To build
|
||||
|
||||
cc -o sykes sykes.c -lcurses
|
||||
|
||||
### To run
|
||||
|
||||
sykes binary_file
|
||||
For your convenience, we have added the above mentioned files to this entry directory.
|
||||
They are used to form the pet.rom file.
|
||||
|
||||
### Author's comments
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,66 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <curses.h>
|
||||
#define P *p
|
||||
#define E (s?s-1?s-2?
|
||||
#define T (s=fgetc(g))
|
||||
#define _ m[n&
|
||||
#define L R(
|
||||
#define b ):L
|
||||
#define G ):(
|
||||
#define r =t&
|
||||
#define F _++k+O]
|
||||
#define W t--?t--?
|
||||
#define Y _ k--+O]=
|
||||
#define M W W W W W W W
|
||||
#define J *E &D:&V:&I:&C)
|
||||
#define q C|Z|I|D|B|V|S|32
|
||||
#define H E Z:C:V:S)&&(d+=P&l?P-O:P)
|
||||
#define U(z,w)(t=w,d+=z,_ t]+_ t+1]*O)
|
||||
int d,C,Z,I,D,B,V,S,i=49152
|
||||
,t,s,o,h,z,O=256,n=65535,l=128,f=255,e,w; unsigned char*p,m[65536],a,x,y,k,*u,
|
||||
*j=" ./ p/ 7 ] . 6 6 p t7 r(0)1*+2,4WgcovGn^f_NVO>F?T\\swldiHZYI9QJ"
|
||||
"RCKSL[b<D8AP:;a@`BXq3j=- HZYI9QJRCKSL[b<D8AP:;a@`BX 57 ; ; ; ; "
|
||||
" ; "
|
||||
" )< <% ><% <% '< <% +< <% 7$ ($A @$A "
|
||||
"($A &$ $A *$ $A C2 2; =2; 62; '2 2; +2 2; D# #B ?#B 6#B &# #B "
|
||||
"*# #B F HFG 1 L HFG 'F HFG NFM F :89 :89 J8I :89 &8 :89 +8K :89 ., "
|
||||
".,/ 5,0 .,/ ', ,/ +, ,/ -E -E3 4E -E3 &E E3 *E E3 2133024425660788"
|
||||
; R(x){ Z=x?0:2; S=x&l; } K(x){ R(x-P); C=x<P?0:1; } A(){ R(t=F); C r 1; Z r 2
|
||||
; I r 4; D r 8; B r 16; V r 64; } X( ){ Y d/O; Y d; } N( ){ X( ); Y q; I=4; d=
|
||||
|
||||
U(0,n-1); } main(int c,char*v[])
|
||||
{ FILE*g ; _ z]=time(0); g=fopen(
|
||||
c>1?v[1]:"", j+32); t=i; if(g) { ;
|
||||
for(; T+1;
|
||||
_ t++ ]=s);
|
||||
w r /* ### COMMODORE BASIC ### */n ;
|
||||
d=w?i: U(C, n
|
||||
-3); /* READY. */z=c>
|
||||
2?atoi( v[2])+1
|
||||
:4; c=z ? n * z
|
||||
/ 4 : n; nodelay(
|
||||
initscr( ), 1 ) ;
|
||||
curs_set(I); cbreak(); noecho( ) ; for (; ;
|
||||
) { o++ % ( c *4) ?h :( h= getch () ,h-ERR?(_
|
||||
162]=h|l):0); if(!w){ s=(_ 59408]
|
||||
|=z?l:0)&15; _ 59410]=~(h-ERR?(s^8?0:j[h|l]&1)|(j[h]/8
|
||||
-5-s?0:1<<j[h]%8):0); } o%c|I||N(); p=m +O+O+ _ l-9]; t
|
||||
=d%65493; i=_ d++]; if(w+t<4){ if(P&&(u=strchr(++p,34)))
|
||||
{ *u=0; _ l-9]=u-m+1; if(g=fopen(p,t?j+61:j+32)){ i=1025
|
||||
-t; if(!t){ T; for(T; T+1; _ i++]=s); for(p=m+42; p<m+47 ;
|
||||
){ P++=i%O; P++=i/O; } } for(; t; fputc(_ i],g))t=_++i]?3:t
|
||||
-1; fclose(g); } } i=96; } t=j[i/2&14|i&1|O+O]&15; e=W W W W
|
||||
U(2,d)+(i-190?x:y):U(2,d)+y:f&_ d++]+(i-150&&i-182?x:y):U(1,_ d
|
||||
])+y:U(2,d):_ d++]:d++:U(1, _ d ] + x & f ):&a - m; p=e
|
||||
+m; s=i>>6; t=j[i+O]-35; M M M W 0 : L a = y G k = x G L
|
||||
a=x)G L x = k ) G L y=a)G L x = a ) G P =y G P = x G P
|
||||
=a G t=a-P-1+C,C r O?0:1,V=((a^ P ) & ( a ^ t )&l)/2 , L a r
|
||||
f)G d=F+F*O+1 G A(),d=F+F*O G t=P,L P=P/2|C*l),C r 1 G t=P,L P=P*2|C),C=t
|
||||
/l):A(b a=F G Y q G Y a G L a|=P)G C=P&1,L P/=2)G L y=P)b x=P b a=P G s=U(1
|
||||
,--d),X(),d=s G d=i&32?U(0,e):e b++y b++x b++P b a^=P b--y b--x b--P):K(y):
|
||||
K(x):K(a G J=0 G J=E 8:8:4:1)G d--,B=16,N() G L a&P),V=P&64,S=P&
|
||||
l):!H:H:(C=P/l,L P*=2)b a&=P G t=a+P+C,C r O?1:0,V=(~(a^P)&(a^t)
|
||||
|
||||
&l)/2, L a r f)); t=e^O*O/2; if (t<1000) { s=P%l; i=A_REVERSE; P>s ? attron(i)
|
||||
:attroff(i); mvaddch(t/40,t%40,s+w<32?s+64:s>95+w?s-32:s); } } } perror(*v); }
|
||||
Reference in new issue
Block a user