You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server
Administration Center

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - ACagliano

I posted about this a while ago on Cemetech and forgot to put it here as well, so here it is.

In addition to my other two big projects (TI-Trek and HASHLIB), I've also been working on another project. It started off as a Steam-style client for connecting to online games such as TI-Trek, but I soon decided it could serve a more targeted purpose. Thus, the project has been rebranded Vapor Package Manager, or VPM, for short.

BOS Package Manager (BPM) is beckadamtheinventor's project, so I will let him elaborate on that end of things, but I included it here and in the topic title to draw some attention to that existing as well.

This project will imitate the functionality of `apt-get`, `apt`, `Homebrew`, `Macports` or any other "package manager" you would have available to you on a *nix style system. It will be released as a Libload-lib with a few functions: `vpm_install(<package>, [options])`, `vpm_remove(<filename>, <filetype>)` and `vpm_reload(void)`. The install function will query the download server for a package with that name. The remove function will essentially just call ti_Delete. The reload function can be used to reload the program that is currently being executed without crashing (this reload mechanism is already implemented in the VAPOR client and it works pretty reliably).

On the host side, the download mirror consists of a directory, `packages` forked into `bpm` for BOS and `vpm` for VAPOR. In each, each available package is in a folder with the package name. For example, Project TI-Trek would be in a folder named `titrek`. That folder would contain any internal dependencies of the project--this is the main program, graphics packs, configurations...whatever is part of the project. The directory also contains a manifest file, manifest.json, in which the author name, description of the project, and external dependencies are listed. For example, for project TI-Trek, the manifest file might look like this:

# manifest.json
    "author": "acagliano",
    "description": "A multiplayer space-combat game",
    "pkg-depends": ["hashlib", "srldrvce", "clibs"]
When the client requests the package titrek, all internal dependencies are fetched. So TITREK.8xp and TrekGFX.8xv. It also parses the "pkg-depends" and fetches the contents of those packages, as well as any dependencies of those packages, constructing a dependency chain (with repetitive dependencies being pruned). So titrek would fetch hashlib which has no dependencies, srldrvce which has a dependency on usbdrvce (which has no dependencies), and clibs which contains the default toolchain libraries. All of the needed files will be streamed to your calculator, updating a manifest table on your calculator which contains the name, type, and SHA-256 of the downloaded program. Files will only be redownloaded if the SHA-256 of the file on the server does not match that in the local manifest.

I believe Beck will craft BPM to function similarly, but I will let him elaborate if he wishes.

As for the other part of "VAPOR", Vapor Proxy Service (VPS), that is a network I have set up for people who want to host calculator game servers, or servers for other calculator utilities such as VPM, BPM, and more to do so. It's free, but I may throw ads on explainer pages for the hosted servers, just to help with the maintenance costs of the server (electricity, internet, domain name, you know the kind). VPS will also support opening a proxy connection between itself and your own server if you want to self-host, but also use some of the security features I plan to implement in VPS.

VPM and VPS will both support packet encryption via HASHLIB. And *if* beck does not support powmod for vint exponents (So I can RSADecrypt within hashlib) then I will also set up a host for the calculator to commune with that can validate SSL certificates that the calculator sends it (I will have to do some research on this).
For the past few months, I've been working with beckadamtheinventor and others on HASHLIB, a library that provides d*mn-near industry standard encryption for the TI-84+ CE. It is a Libload Library, meaning it works the same way as the other libraries distributed with the toolchain (GRAPHX, FILEIOC, etc). Simply send HASHLIB.8xv to your calculator, move the .lib and .h file to your $CEDEV/lib/libload and $CEDEV/include directories respectively, then `#include <hashlib.h>` in your C project source. At this point you can use any of the functions in hashlib in your code.

HASHLIB provides the following crypto standards:

(1) SHA-256 Hash
A rather fast implementation of the SHA-256 crypto hash. First written in C, myself and beck endeavored to rewrite it in EZ80 Assembly because the C version was quite slow. I started things off with a code of the Init, Update, and Final functions and a skeleton of the transform function. Beck "corrected" any mistakes I made due to my Asm knowledge being (1) rusty, and (2) from Z80 Asm, as well as optimized all of the functions, and wrote much of the transform math routines. The current SHA-256 implementation sports a speed increase of 9x over the C version, and can fully hash GRAPHX, the largest of the toolchain libraries, in ~1.5 seconds.

(2) An Entropy-Based Secure Random Number Generator
This PRNG, unlike the toolchain's default is not deterministic in nature. It works by polling every bit in the CE's unmapped memory, searching for a floating bit with the least bias, upon which it sets its state internally to read from the address containing that bit. An add entropy function can be called by the user, but is also called automatically every time a random number is generated. This function reads from the entropy source to a reserved pool 192 bytes large. Because the maximum bias accepted by the entropy source selection function is 75/25, this gives us an entropy of .811 bit per byte, which multiplies out to ~150 bits of entropy for the entire pool. Bear in mind that is the worst case entropy possible--the entropy source selected will likely be higher. This entropy goes into generating a 32-bit random number; the pool is hashed using SHA-256 and then xored cyclically into the random number. The PRNG passes all Dieharder tests when run on 16KB of data as well as 1MB of data.

(3) Advanced Encryption Standard, CBC Mode
As the above implies, HASHLIB provides routines for encrypting and decrypting data using the CBC mode AES block cipher. This implementation has support for 128, 192, and 256 bit keys. Additionally, the CBC-MAC protocol is also provided, which you can pass data to and generate a message authentication code one block size in length. The library provides a macro that takes a plaintext, padding scheme, an output buffer, and two AES key schedules (one for encryption, one for MAC), as well as an IV. It encrypts the plaintext using the IV and encryption key schedule (padding appropriately), then runs the CBC-MAC algorithm on the encryption output and the IV, using the MAC key schedule (the MAC variant of the CBC cipher does not take an IV, but rather initializes it to a constant value causing it to act more like a counter than a nonce), appending the output of that MAC function to the ciphertext, providing an authenticated encryption scheme derived from IPsec.

(4) RSA, Encryption Only
A WIP; This library will also provide support for public key encryption over RSA keys of a modulus length up to 2048 bits. It will depend on a BIGINT lib by beckadamtheinventor currently a WIP as well (which is why RSA is still not added). Because generating two random coprime prime numbers of the required size on a CE would likely take a very long time, I decided to implement the encryption part only. Use this implementation in a server-centric setup where a server generates an RSA keypair, sends the public key to your calculator, and then the calculator encrypts a shared secret for AES, sends that to the server, and then the two communicate using AES.

(5) Padding Schemes (and Strip Padding)
HASHLIB provides functions to implement the ISO, PKCS7, and ANSIX928 padding schemes for AES as well as OAEP for RSA. For those who don't know, the ISO scheme pads with the byte 0x80 and then the bytes 0x00 until the end of the block. The PKCS7 scheme pads with the size of the padding. The ANSIX scheme pads with randomness. For OAEP, the scheme is implemented as indicated by the standard (a Feistel network where the message is padded with zeros to the modulus length minus 16, a 16-byte salt is generated, hashed, and xored with the message. The encoded message is then hashed and xored with the salt, and the encoded message and encoded salt are the OAEP-encoded plaintext). However, rather than an expandable hashing oracle, SHA-256 is applied cyclically to the message. This was done predominantly to save space in the library by using an existing hash rather than adding a new one specifically for this purpose.

The "Strip Padding" functions all properly strip the padding, returning the unpadded plaintext into a provided buffer as well as the size of the unpadded data into a return value. The only padding scheme it cannot decipher is ANSIX; if you are using this padding mode, you will have to know the expected plaintext size.

Other Functions Provided:
(a) hashlib_CompareDigest(): buffer comparison function that is resistant to timing attacks (written by jacobly in ez80 Assembly)
(b) Base64 Encode/Decode: Added these planning to implement bcrypt, but when Blowfish was replaced with AES, decided to just leave them in.
(c) Macros to return the padded size of an AES/RSA plaintext, useful for allocating a buffer large enough.
(d) Context erase function. When you are done with an SHA, AES, or RSA context, you can pass it to this function to write zeroes to it, erasing all traces of cryptographic state.

Special thanks to:
(1) beckadamtheinventor: Converted many of my C routines into EZ80 Assembly for speed
(2) Zeroko: Provided useful information on extracting entropy from the CE
(3) jacobly: Rewriting hashlib_CompareDigest() in EZ80 Assembly
(4) B-Con crypto algorithms, which was my source for the base of the AES and SHA implementations.

Project Page:
Drawing & Animation / Sprites for Star Trek MP
August 24, 2018, 06:37:26 PM
So I'm posting here to see if anyone wants to help me out with sprites for the Star Trek multiplayer demo. Currently requested sprites are:

1. Phaser bolt (weapon)
2. Photon torpedo (weapon)
3. Quantum torpedo (weapon)
4. The Narada (from Star Trek 2009) (ship)
5. Weapon-on-shield clash flare (vfx)
6. Explosion (vfx)

For the weapons, either a 32x32 or a 64x64 will suffice.
For the Narada ship, you can use your own discretion as to the size of this sprite. Keep in mind that the Narada is a massive ship.
For the vfx, please keep to a 32x32 or a 64x64.

Also, something I'd like input on. I want to show on the screen some sort of spark rain effect that you'll be seeing periodically when your ship's hull integrity module is below 25% health. Examples of the effect I want to create are here:

Also if I want to shake the screen in response to a weapons impact, what's the best way to do this? In C. Substituted "screen corruption" effect.
**Early Access Beta Release** A suite of calculator security tools that actually functions, unlike many of the fake tools that just search for names like VIRUS, or don't scan at all. This program already has the ability to: - Save and update a database of all Programs or Protected Programs on your calculator, consisting of their names, sizes, and a 24-bit checksum. - Compare the current version of the program with the version in the database, and inform you if the size or checksum don't match. - Ability to scan your programs/protected programs for byte sequences that are potentially hazardous, via a virus definitions file that will be community-sourced. - Save your calculator's date and time settings in a secure location, thus preserving it across RAM clears. Every time you run this program, the date/time are either silently re-saved (if later) or restored (if earlier). Upcoming Features: - Ability to view/modify virus definitions on calc. - A firewall to integrate with any networking protocols devised for the CE. - Program running hook to allow the virus scan or checksum scan to be run on a specific program before it runs (disable-able)
Calculator Development / TI Slender for the CE
January 26, 2018, 04:23:42 PM
Concurrently to Star Trek for the CE, I've been putting together a Slender port. I decided to update this project while pushing forward on Star Trek because the rendering system is essentially identical. However, when I built the project, I started getting a weird glitch. I've enclosed a screenshot of it, as well as a link to my source. Anyone who has made a pseudo-3d engine (2d map to 3d graphics) is welcome to take a look and see where I'm going wrong.

The issues:
1. Moving causes sprite double-vision, followed by the totally wrong sprite.
2. You see nothing on the map except Slenderman and a car in the same location no matter what, in spite of the positions of everything being random every time.

Here's a link to the source, for anyone wishing to review:
I've been talking about it for a while. Asking questions about how to do this or that. But without any real progress.

Scroll down for a question I have about ship/terrain assets.

Well as of the past week or so, that has changed. I sat down, turned off my Minecraft (with great internal suffering) and got to work. Over the past week, I succeeded in creating the shields, the major non-combat systems, damage reception, power control, and more.

At this point in time, there is no networking implemented and the file is quite large (~15kb). Much of this is due to graphics and AI calculations which, when networking is implemented will no longer be present. The intent is also to hold graphics server-side and send the relevant sprites to the calc during runtime, which will be saved in a temporary assets file. Also, as Kerm told me that CALCnet will likely not be a thing for the CE due to differences in network protocol, I'll probably use the existing USB protocol on the CE with a computer side program to send data to the hub, which would have the ability to interact with connected CE's and CALCnet, allowing the color and monochromes to play on one server. I'll also open source this when done to allow it to be ported to the CSE.

But more on that later. I have very little left to do before I can release a demo. Basically just AI ship control, player ship control, rendering the viewscreen, and firing. In the scope of what I've done already, that shouldn't take too long.

Now, feast your eyes on some screenshots:

The Question:

This game is played in a virtual 3D world. The map objects and ships are technically 3D. My question is, would it be better, both in terms of rendering speed and data size, to create several versions of each sprite, to view the object from different angles, or to create full 3D models for the ships and the spherical map objects (the irregular objects will be rendered differently). For full 3D, I could make 16x16x16 models for each item, leading to an overhead of 4096 bytes per object, which if it's in an external assets file on the CE isn't a major issue. When this game eventually gets backwards-ported to the monochrome calcs, we'd be talking about 512 bytes per object.

If the common consensus is the latter (3d models), is there someone here who has experience making them?
So after trying time and time again to run TokenIDE using wine and mono for the BasicColors palette, I am finally giving up on this program. Therefore I need either a sprite maker who can run TokenIDE, a version of TokenIDE that works on OSX, or the BasicColors palette (as a file?) for me to import into Gimp.

So I'm looking for someone decently skilled with C programming to help me learn the ropes of designing a textured raycaster. I have a textured raycaster in C++ that I've been trying to port, but my skills aren't sufficient enough to percieve differences between C and C++ and implement proper substitution, so I am asking for help.

ps: the C++ snippet im looking at is
I'm trying to get a font made for the TI-84+ CE. Any takers? You can private message me here or email me at [email protected]. :)
Calculator Talk / CE Development Environment
August 09, 2016, 11:50:12 PM
As someone starting to transition from normal 83+/84+ assembly development to 84+ CE development, I am curious what software you guys who develop for the CE use to assemble and link programs for the 84+ CE. Thanks in advance.
As many of you know I've been working on a project that entails the use of Python for networking. I have made significant effort to learn Python, and while I know how the language works, learning how to create an application with networking is a whole other ball game. I need a hands on approach to this and therefore am asking anyone here who knows Python at this level to PM me or comment and ill discuss what im trying to learn to do and what i need.

edit: here are some details. This is for the calcnet server to my Star Trek game, a realtime MMO, where calculators render graphics and do some stuff like firing weapons and changing position/direction. Every time a packet containing something (a client join/leave, a weapon fired, a change in direction and speed, a chat message, etc) is sent to the calcnet "server", the server responds in some fashion. It could be as simple as retransmitting the packet to another unit, adding an "object" to a database of objects in the virtual world, changing its coordinates or status, or sending information about environment to a unit. If you head to my project page, and go to "Features", you'll see some of the things I want to do.

Thanks in advance.
Calculator Development / Slender Opened and Fan Film
January 29, 2016, 03:02:27 PM
Though my Slender game remains almost finished, between work, a few other projects, and RL things, I'm worried that it will be quite some time before the game is completed. For this reason, I am providing below the credentials needed to access the GIT account on my server where slender's source is hosted. Anyone who wants to contribute need simply modify the code, add their name in a comment, and push the changes. *At some point today I will be checking out the repo to make sure that it has the latest code*. I'm opening the project simply so that those of you who supported and are looking forward to this project can see it done faster, and perhaps even have a hand in its completion.

Server Name:
User: git
Password: tiCalcDevs
Path to game source: /home/git/repos/slender1.git
Supported commands: Anything related to git, and scp.

Secondly, and on an only marginally related topic, one of the projects I've undertaken, in conjunction with some friends is to make a Slender fan film. The topic is something to my knowledge never done... the origin of Slenderman. I have the necessary software a storyboard already, have parts of the script done, and a sizable crew together. If there's anyone who lives in the NYC area (or elsewhere) who wants to join in, PM me. Also, I set up a gofundme campaign for this project at Anyone who wants to support the project, feel free, or if not, distribute the link please. Also, if anyone does donate, I'd ask they either PM me or email me at [email protected], because when the project reaches completion I intend on sending everyone who contributes a disbursements record, and refunding any excess.

I have completed a TI-Basic version of the game Yahtzee and uploaded the first release candidate here. Please know that this is an unofficial release. If you find any bugs, please post them in this thread. Thanks.
Calculator Development / Calculator Strange Behavior
January 20, 2016, 01:46:01 AM
For a while, I have been working on a Yatzee game for the calculator. Testing it in the emulator produced some weird results, namely graphics issues, and crashes. Upon most careful observation, I noticed that at some point, the value of HL was not changing. Even an instruction like ld hl,Address would leave HL unchanged and pointing to $0000. This was causing a great deal of other issues, including executing from that address and writing to it. At one point, this even caused the program to execute my jmptbl label as code, not as data.

Thinking that this might be an emulator issue, against my better judgement I decided to run the program on my calculator (yes, I do dumb things sometimes). Ever since then, I have had weird issues with sending files to and from my calculator. It worked once more since, but every other time, sending a program or app of any kind yields "Serious communication error has occurred" in TI Data Editor. The calculator shows up in the aforementioned program, but I cannot view anything on the device or send a file to it. TILP cannot even detect the calculator present. Using the TI-OS Restore program works fine to send a new OS to the calculator, but my connectivity issues persist.

What the heck is going on? Could I have damaged something else critical to the transfer? Is my computer's port not working? The calculators? But I would think that a hardware issue would mean I can't send a new OS either.

I've enclosed the program I ran on the calc here.
Web / The Big Bad Duplex of Website Issues
October 29, 2015, 09:46:46 PM
Issue 1 - Weird Select Tag Behavior

Issue: Click on "Post a Bug". In the widget that pops up, the drop down menu is properly formed but I also get the selected option echoed back out in front of the object. Why? Code for the entire page is here:

Issue 2 - Weird Slender page glitch

Issue: Clicking on a link at the bottom of the page creates a text shadow from the previous page for some users. Why? There is no javascript bound to a click event. Only the first link works.
Calculator Development / A Slender series for the 83+/84+
September 30, 2015, 08:32:22 PM
Coming soon to a calculator near you, and based on the hit horror series, I have decided to create a three-part original Slender series. Most elements of gameplay will emulate that of other PC Slender games, but the storyline and mechanics will slightly differ. I don't want to give too much away. As of now, a lot of the game is programmed, with the exception of raycasting, frame-drawing, and creating a map. I also want to improve the AI.

I do have a private repository dedicated to the project for anyone who wants to contribute or help, but there isn't too much left to do. Mainly spritework. Anyone interested can comment or PM.
Website statistics

MyCalcs | | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | | Casiopeia | The Museum of HP Calculators | | | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal