What is all this?
The Programmable Tile Machine, or PTM for short, is a computer program for Microsoft Windows systems that implements a virtual machine. The PTM is not an emulator of any existing computer system, it's an invented machine that exists solely in software form, no hardware implementations exist. Its primary goal is to allow programmers to create and distribute simple games just for the fun of it. This is what the PTM looks like in action:
Who's behind this?
The PTM project is currently developed and maintained by a single person. Hello, my name is Fernando Aires Castello, and I'm a computer scientist from Brazil. I work as a programmer for a software development company and I develop games and other projects such as this one during my spare time.
When did this start?
The PTM project was started on April 24th, 2015. This is a work in progress.
Why does this exist?
I started developing this project because I am very fond of, not to mention obssesed with, old technologies, computers and games. I like how relatively simple computers were back in the 70's and 80's, compared to the complexity of computer systems in the current era. Most old computers were unique, with their own characteristics, their own software and hardware, their own quirks and secrets, and their own programming languages. Memory in those computers was extremely limited, some of them with only 8, 16 or 64 kb of RAM. They were usually programmed in assembly language, sometimes even directly in machine language, or in some BASIC dialect. They also had limited graphical capabilities, some of them could only display 8, 16 or 32 colors on the screen and had a very small resolution so that pixels appeared to be small rectangles rather than dots, which is often the cause of the "blocky" aspect of their graphics display. The PTM was designed to look and feel just like those old computer systems.
This project exists primarily because I wanted to be able to program and do things in my own "machine" (especially retro-looking games), with a unique system that I had designed, in a unique language that I had created. I decided to create this blog and distribute this system with the assumption that there are people out there who might like the idea as much as I do. Since the PTM emulates many features of real computers (such as ROM and RAM, stack, filesystem, keyboard, sound, graphics, etc) and is completely programmable, it can be used by programmers (hobbyists or otherwise) to create and distribute very simple applications and games, just for the fun of it. Also, the PTM can be used to help people learn how to program in a low-level language.
Where can I get this?
If you are interested, you can download the PTM by clicking the relevant link on the sidebar of this blog. The download package is not an installer, it's just a ZIP file containning all the system files along with documentation and a few sample programs to get you started.
How can I use this?
After you have downloaded the system package, you simply need to unzip the folder somewhere, that's how the PTM is installed. This folder is referred to as "the system folder" because that's where the system executable is located. Inside the system folder you will find the system executable (ptm.exe), the SDL runtime library (sdl.dll), the settings file (settings.ini) and several sample program files (all with a .prg extension).
To execute any program you first have to run the system executable. It will display a list of all programs in the system folder. Highlight the name of the program file that you wish to execute with the UP/DOWN keys then press the ENTER key to run it. You can press SHIFT + ESCAPE to exit the program. If you want to create your own programs, you'll need to learn PTML, which is the programming language of the PTM. Then you can write your PTML programs and save them to files with the .PRG extension inside the system folder so that they can be located. To learn PTML, you should read all the documentation in this blog.
Can I distribute my own programs?
Yes. The PTM is designed to allow you to create your own programs and distribute them in any way you like. You can actually create a standalone program for the PTM without users even knowing that it's the PTM by following these steps:
- Create your PTML program file(s)
- Rename the system executable (ptm.exe) to any name you like (e.g. My Standalone Program.exe)
- Configure the settings.ini file to set the default window title to whatever you like (e.g. My Standalone Program)
- If you want to distribute multiple programs as part of a single "package", you can either keep the default behavior of the system which is to launch the so-called "Program Loader" (the selection screen that allows you to choose what program to run) on startup, or you can configure the settings.ini file to automatically execute a "main" program, thus bypassing the Program Loader. Then you have the option of loading different programs from within your "main" program by using a specific PTML instruction.
- Then just put everything inside a folder with whatever name you like (e.g. My Standalone Program), which will be the system folder. You can ZIP this folder and upload it somewhere or just send it to whoever you like. You can actually send me your programs if you want them showcased in this blog (please do).
Where can I get help?
On this blog, by reading all the documentation. If you encounter any bugs in the system, or if you want to suggest features or ask about anything that is not in the documentation or that you think isn't clear enough, send me an e-mail and I will answer as soon as possible: email@example.com