Discussion:
Ladder-like game
Add Reply
Nils M Holm
2024-02-06 16:35:12 UTC
Reply
Permalink
I recently wrote my own version of the Ladder game, mostly because
the original game is too hard for me. :)

Download: http://t3x.org/t3x/0/ladders.zip

The zip file contains executables for CP/M and DOS as well as the
source code in T3X.

As a side-effect the T3X/0 compiler (http://t3x.org/t3x/0/) now has
a console module that does things like clearing the screen, cursor
addressing, etc. In the default configuration the game needs a
VT-100 terminal, but support for the VT-52 is also in the code and
just needs to be enabled.

Enjoy!
--
Nils M Holm < n m h @ t 3 x . o r g > http://t3x.org
Bozo User
2024-04-02 17:31:54 UTC
Reply
Permalink
Post by Nils M Holm
I recently wrote my own version of the Ladder game, mostly because
the original game is too hard for me. :)
Download: http://t3x.org/t3x/0/ladders.zip
The zip file contains executables for CP/M and DOS as well as the
source code in T3X.
As a side-effect the T3X/0 compiler (http://t3x.org/t3x/0/) now has
a console module that does things like clearing the screen, cursor
addressing, etc. In the default configuration the game needs a
VT-100 terminal, but support for the VT-52 is also in the code and
just needs to be enabled.
Enjoy!
Interesting. But compiling and setting up t3x/0
is not straightforward, at least under GNU/Linux i686.
Here's the variables I changed in the makefile
and the sh script at bin/ :

T3XDIR= $HOME/t3x/lib
BINDIR= $HOME/t3x/bin

Then I ran

make reset ; make all-native ; make install-native

everything looked ok.
But, on compiling ladders:

.LANG=C make
tx0 -t unix-386 -c ladders
Text = 0x0001B415, Data = 0x00000C00, Symbols = 144, Nlist = 961, Labels = 1515
ladders.s: Assembler messages:
ladders.s:6: Error: invalid character (0x80) in mnemonic
ladders.s:7: Error: invalid character (0x80) in mnemonic
ladders.s:8: Error: invalid character (0x80) in mnemonic
ladders.s:9: Error: invalid character (0x80) in mnemonic
ladders.s:10: Error: invalid character (0x80) in mnemonic
ladders.s:11: Error: invalid character (0x80) in mnemonic
ladders.s:12: Error: invalid character (0x80) in mnemonic
ladders.s:13: Error: invalid character (0x80) in mnemonic
ladders.s:14: Error: invalid character (0x80) in mnemonic
ladders.s:15: Error: invalid character (0x80) in mnemonic
ladders.s:16: Error: invalid character (0x80) in mnemonic
ladders.s:18: Error: invalid character (0x80) in mnemonic
ladders.s:19: Error: invalid character (0x80) in mnemonic
ladders.s:20: Error: invalid character (0x80) in mnemonic
ladders.s:21: Error: invalid character (0x80) in mnemonic
ladders.s:22: Error: invalid character (0x80) in mnemonic
ladders.s:23: Error: invalid character (0x80) in mnemonic
ladders.s:37: Error: invalid character (0x80) in mnemonic
ladders.s:38: Error: invalid character (0x80) in mnemonic
ladders.s:39: Error: invalid character (0x80) in mnemonic

Which could be the issue?
Nils M Holm
2024-04-03 09:11:07 UTC
Reply
Permalink
Post by Bozo User
Interesting. But compiling and setting up t3x/0
is not straightforward, at least under GNU/Linux i686.
Here's the variables I changed in the makefile
T3XDIR= $HOME/t3x/lib
BINDIR= $HOME/t3x/bin
[...]
Which could be the issue?
Ah, thank you so much for the feedback!

Indeed there is something I forgot to mention in the README:

If you change T3XDIR, you also have to change the "modpath"
in your code generator accordingly. In your case, change

"/usr/local/t3x/0/unx386/"

in the function "modpath" in the file "targets/cgunx386.t" to

"your-home/t3x/lib/unx386/"

and, of course, change "your-home" to whatever the actual
path is. $HOME will NOT work.

Without this change, the compiler will fall back to the default
core module and emit a mix of assembly language and bytecode,
which will confuse the assembler.

Let me know if this solves the problem!
--
Nils M Holm < n m h @ t 3 x . o r g > http://t3x.org
Nils M Holm
2024-04-03 09:33:02 UTC
Reply
Permalink
Post by Nils M Holm
If you change T3XDIR, you also have to change the "modpath"
in your code generator accordingly. In your case, change
"/usr/local/t3x/0/unx386/"
in the function "modpath" in the file "targets/cgunx386.t" to
"your-home/t3x/lib/unx386/"
And also "/usr/local/t3x/0/" to "your-home/".

It is documented in the README now.

Next step: write a script that will do the changes for you.
--
Nils M Holm < n m h @ t 3 x . o r g > http://t3x.org
Nils M Holm
2024-04-03 10:18:23 UTC
Reply
Permalink
Post by Nils M Holm
Next step: write a script that will do the changes for you.
Done and uploaded. Please use the new version:

http://t3x.org/t3x/0/t3x0-20.zip
--
Nils M Holm < n m h @ t 3 x . o r g > http://t3x.org
Bozo User
2024-04-05 13:11:17 UTC
Reply
Permalink
Post by Nils M Holm
Post by Nils M Holm
Next step: write a script that will do the changes for you.
http://t3x.org/t3x/0/t3x0-20.zip
It works, but on the make install steps, it gave me an error,
I had to run 'mkdir -p $HOME/t3x0/{bin,lib}' first.
If not, the binaries get copied literally as $HOME/t3x0/bin
being 'bin' a single file, not a directory.
Nils M Holm
2024-04-05 16:27:08 UTC
Reply
Permalink
Post by Bozo User
Post by Nils M Holm
http://t3x.org/t3x/0/t3x0-20.zip
It works, but on the make install steps, it gave me an error,
I had to run 'mkdir -p $HOME/t3x0/{bin,lib}' first.
If not, the binaries get copied literally as $HOME/t3x0/bin
being 'bin' a single file, not a directory.
Ah, I see. The lib directory should be created by install -d,
because it also creates parent directories, at least on FreeBSD.

$BINDIR is intended to point to a location where you keep *all*
your binaries, not just T3X, e.g. /usr/local/bin or $HOME/bin.
Therefore the Makefile assumes that it already exists.

Will clarify this in the Makefile.

Thanks for the input!
--
Nils M Holm < n m h @ t 3 x . o r g > http://t3x.org
Bozo User
2024-04-05 22:00:02 UTC
Reply
Permalink
Post by Nils M Holm
Post by Bozo User
Post by Nils M Holm
http://t3x.org/t3x/0/t3x0-20.zip
It works, but on the make install steps, it gave me an error,
I had to run 'mkdir -p $HOME/t3x0/{bin,lib}' first.
If not, the binaries get copied literally as $HOME/t3x0/bin
being 'bin' a single file, not a directory.
Ah, I see. The lib directory should be created by install -d,
because it also creates parent directories, at least on FreeBSD.
$BINDIR is intended to point to a location where you keep *all*
your binaries, not just T3X, e.g. /usr/local/bin or $HOME/bin.
Therefore the Makefile assumes that it already exists.
Will clarify this in the Makefile.
Thanks for the input!
No problem!!

I already compiled an interpreted version under a shared
pubnix with OpenBSD/amd64, people liked having a 'native'
Ladder a lot, at least they don't have to run an Altair
simulaton under simh.
Nils M Holm
2024-04-07 13:01:09 UTC
Reply
Permalink
Post by Bozo User
I already compiled an interpreted version under a shared
pubnix with OpenBSD/amd64, people liked having a 'native'
Ladder a lot, at least they don't have to run an Altair
simulaton under simh.
Interpreted T3X is easily good enough for the ladders game.

For running CP/M programs without having to start a full
emulator I often use tnylpo (https://gitlab.com/gbrein/tnylpo).
It runs CP/M programs on the Unix command line using the cwd
as its file system.
--
Nils M Holm < n m h @ t 3 x . o r g > http://t3x.org
Loading...