about summary refs log tree commit diff stats
path: root/README.txt
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-09-20 11:51:43 -0400
committerCharadon <dev@iotib.net>2022-09-20 11:51:43 -0400
commit4ea69698424f7bfe93d0e9142f6f50c0583ef168 (patch)
treec3f58f835c319d4cc5aacbfb00665042fbca3edb /README.txt
parent4a01250a8572ae2965b27e9a11daa9820e0433d2 (diff)
downloadPong-C-4ea69698424f7bfe93d0e9142f6f50c0583ef168.tar.gz
Updated README.txt
Diffstat (limited to 'README.txt')
-rw-r--r--README.txt18
1 files changed, 17 insertions, 1 deletions
diff --git a/README.txt b/README.txt
index 1b39cd8..fdc75a2 100644
--- a/README.txt
+++ b/README.txt
@@ -31,7 +31,7 @@ My goal with this project is:
        is the only way I can learn.
 ===============================================================================
 Build with Tup:
-    1. Modify tup.config to your needs.
+    1. Copy/Modify tup.config to your needs.
     2. Run `tup`
     3. Run ./install.sh
     4. Done
@@ -41,5 +41,21 @@ Build without Tup:
     1. Run ./build-$RELEASETYPE.sh (release if packaging, debug if debugging)
     2. Run ./install.sh
     3. Done.
+Distributing:
+    This is complicated, and depends on your platform. On most systems, the best
+    way to redistribute binaries is to use a combination of ldd and awk.
+    Example:
+        mkdir -p libs/
+        for i in $(ldd ./Pong | awk '/usr\/lib/{print $3}');
+        do
+            cp $i libs/
+        done
+    The syntax you'll have to use depends on your system, OpenBSD for example
+    stores packages in /usr/local. Not to mention this method is unreliable on
+    many linux distributions due to /lib and /usr/lib being the same
+    directory. On Windows, the libraries should be in the same directory as
+    the executable.
+
+    From there, just simply tarball or zip up the game with the libraries.
 ===============================================================================
 If you like my work and want to support me, consider donating to me on https://liberapay.com/Charadon/
lor: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
type file-state {
  source: (handle buffered-file)
  eof?: boolean
}

fn init-file-state _self: (addr file-state), filename: (addr array byte) {
  var self/eax: (addr file-state) <- copy _self
  load-file self, filename
  var eof/eax: (addr boolean) <- get self, eof?
  copy-to *eof, 0  # false
}

fn load-file _self: (addr file-state), filename: (addr array byte) {
  var self/eax: (addr file-state) <- copy _self
  var out/esi: (addr handle buffered-file) <- get self, source
  open filename, 0, out  # 0 = read mode
}

fn next-char _self: (addr file-state) -> result/eax: byte {
  var self/ecx: (addr file-state) <- copy _self
  var source/eax: (addr handle buffered-file) <- get self, source
  var in/eax: (addr buffered-file) <- lookup *source
  result <- read-byte-buffered in
  # if result == EOF, set eof?
  compare result, 0xffffffff  # EOF marker
  {
    var eof/ecx: (addr boolean) <- get self, eof?
    copy-to *eof, 1  # true
  }
}

fn done-reading? _self: (addr file-state) -> result/eax: boolean {
  var self/eax: (addr file-state) <- copy _self
  var eof/eax: (addr boolean) <- get self, eof?
  result <- copy *eof
}

fn dump in: (addr buffered-file) {
  var c/eax: byte <- read-byte-buffered in
  compare c, 0xffffffff  # EOF marker
  break-if-=
  var g/eax: grapheme <- copy c
  print-grapheme 0, g
  loop
}