Skip to content

Commit 0efb151

Browse files
committed
Switch to C
Because I was getting writer's block with python. Likely'll be faster, too. tis.c: The main file tis_io.[ch] Handles input/output Only does ASCII for now tis_node.[ch] Handles the behavior of the different node types Only does compute nodes for now tis_ops.[ch] Handles the operations of compute nodes (mov, add, jmp, etc.) tis_types.h A whole bunch of typedefs, defines, and the like Makefile: Take a wild guess
1 parent fa8f8d3 commit 0efb151

13 files changed

+1120
-654
lines changed

Makefile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
CC=gcc
2+
#CFLAGS= -Wall -Wextra -Wpedantic -O3 -std=c11
3+
CFLAGS= -Wall -Wextra -Wpedantic -O0 -std=c11 -g
4+
RM=rm -f
5+
6+
OBJECTS=tis.o tis_io.o tis_node.o tis_ops.o
7+
8+
tis: ${OBJECTS}
9+
10+
tis.o: tis_types.h tis_node.h
11+
tis_io.o: tis_types.h
12+
tis_node.o: tis_types.h tis_ops.h tis_io.h
13+
tis_ops.o: tis_types.h tis_node.h
14+
15+
tis.f: tis.f.o tis_io.o tis_node.o tis_ops.o
16+
${CC} $^ -o $@
17+
tis.f.o: tis_types.h tis_node.h
18+
tis.f.c: tis.c tis_types.h tis_ops.h
19+
grep "#include <" $< > $@
20+
grep -v "#include <" $< > tis.temp.c
21+
${CPP} tis.temp.c -o tis.temp.i
22+
grep -v "^#" tis.temp.i >> $@
23+
-${RM} tis.temp.c tis.temp.i
24+
25+
all: tis tis.f
26+
27+
clean: cleanobj cleanexe cleanf
28+
cleanobj:
29+
-${RM} ${OBJECTS}
30+
cleanexe:
31+
-${RM} tis
32+
cleanf:
33+
-${RM} tis.f tis.f.o tis.f.c
34+
35+
.PHONY: all clean cleanobj cleanexe cleanf

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
A TIS-100 emulator, for the wonderful Zachtronics game of the same name. Uses TIS-100 save file format.
33

44
None of the others available did quite what I wanted, so I'm going to try my hand at making my own.
5+
6+
(useful links for dev'ment:)
7+
https://alandesmet.github.io/TIS-100-Hackers-Guide/

sample/cat.tis100

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
#!./tis100.py -ix-xx -oxx-x
2-
@1
1+
@0
32
MOV UP ANY
4-
@5
3+
@4
54
MOV UP ANY
6-
@9
5+
@8
76
MOV UP ANY
7+
@9
8+
MOV ANY RIGHT
89
@10
9-
MOV ANY ANY
10+
MOV ANY RIGHT
11+
@11
12+
MOV ANY DOWN

sample/simple.tis100

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!./tis100.py -i- -nc -o-
21
@0 # Indicates that this is node 0
32
ADD UP # Gets input and adds it to ACC, the only addressable register in a T-21
43
G: # Defines a label called "G"

0 commit comments

Comments
 (0)