At the end of the first half of the 90s, the first Sony console, the Playstation 1 or PSX, hit the CIS market. It can be considered unique from many points of view, but for all of us the main difference was probably the fact that at last a full-fledged video appeared in the games, sane 3D graphics, and the possibility will not be saved with a password, frantically searching for a piece of paper (forgive me readers for the awkward comparison that has arisen in their heads), and, as befits a white person, on a digital medium.

In fact, this console marked a quiet revolution in the programming of games. That is what I would like to talk about today. And what's more, if you want to write your game for the console gathering dust in the pantry, thus avenging the creative powerlessness experienced in adolescence, then under the cut you can get an idea of ​​how to do it.
')
Some facts
It is important to know:
- The Playstation was the first common console that supported normal full-color video playback. For this, the console had a special chip that supported hardware decoding of a format close to JPEG. Nevertheless, the developers had to manually draw each frame and synchronize the audio track.
- Due to hardware limitations, it was impossible to copy bitmap sizes larger than 256x256 pixels into video memory at once - so all the panoramas in the background were drawn in 2-4 passes.
- To play from pirated discs, it was necessary to perform the console chipping operation; for this, a special controller was soldered onto the console motherboard, giving the Playstation a persistent long-lasting illusion that the cheap disc in its depths is a licensed disc. Find unchip console in the CIS most likely was impossible. In the west, the same problem was solved more legally - for this, a disk substitution trick was used: during boot BIOS a licensed disk was inserted, and immediately after it a disc with the game that was required to be started.
- Memory card is a regular flash drive with a capacity of 128 KB.
- There was a mouse for the Playstation. But who knew about this?
- On the console, you could play Video CD. But who knew where to get them?
- The release of the Playstation 1 in the vast expanses of far-off Asia was suspended only because Sony needed large production capacities to increase the release of the Playstation 3. It can be considered March 23, 2006, to be a day of mourning.
- Most games for the Playstation have a resolution of 320x240.
- Almost all the Chinese Playstation clones on the market today run games in emulation mode, the hardware is different from the original, which leads to the inoperability of some games. But you can watch bought in the next tent DVD.
- The last game for the Playstation, which is neither a reprint nor an artisanal craft, was released in 2005. Total games were released about 8,000.
- Just as events like Perl Workshop are being held now, then developer meetings were held to share experiences and demonstrate prototypes of games under development. The material of each such rally was released on a disc, the contents of which were very similar to what was on the black demo discs that came with the Playstation. If you collect them all, then you can look down on local philatelists.
- The most common method of “cutting back” games in order to create pirated compilations was to replace all video files with short “stubs” - second clips with a black screen.
- In gaming clubs there were fights due to the fact that there was not enough space on the memory cards. In general, the relative cheapness of the Playstation led to the fact that the first gaming clubs massively opened on its base. So it was in the periphery, in the capitals the clubs with Sega or just computers were before.
Where does the difference begin
Few people know, but programming for other common consoles of that time was a living hell (from the point of view of a programmer who does not have a love for assembler). Gamedev of that time rather resembled modern programming of microcontrollers, with all the ensuing consequences - the lack of a normal interface to the file system, manual generation of sound frequency, access to I / O ports for each operation, and assembler, assembler, a lot of assembler. There were other small pleasures like several processors in one console, or RAM that does not have a continuous range. All the little things you can not remember. The only prefix of that time that could boast of humanism in relation to the programmers was the Panasonic 3DO, which still did not find popularity in the CIS (and the rest of the world, too).
To understand the degree of hopelessness that occurred when programming for the then most common prefixes, take a look at these characteristics:
Console | CPU | RAM capacity | Media Restrictions | Video memory capacity |
---|
Dendy / Nes | 1.66-1.79 MHz | 2 KB | 48 KB | 2 KB |
Sega mega drive | 7.61 MHz | 64 KB | 4 MB | 64 KB |
Playstation 1 | 33.8688 MHz | 2 MB | about 700 MB | 1 MB |
Of course, there were tricks to increase the capacity of cartridge consoles - a cartridge, in fact, an electronic circuit, with a lot of conclusions, not all of which were intended to read data from a cartridge's ROM. What can be placed on the diagram? Yes, anything - additional RAM, ROM controller with the possibility of mapping the data of big games into the allowed I / O address space. The main thing is that the console supports the interface for interacting with similar devices of the cartridge. And she, as a rule, supported! Thus, the programming of games was not limited only to the development of code, sometimes it was necessary to “finish” the game by hardware in order to somehow surpass the meager capabilities of consoles of that time. However, few of the many who have Dendy in the post-Soviet space have been fortunate enough to deal with cartridges that accommodate a mythical and semi-divine being - namely, a “battery” to which the game could be saved.
This obscenity ended with the arrival of the Playstation: firstly, the console had quite impressive characteristics and could compete with computers of the time on which DOS worked (which caused a considerable number of games that were ported from PC to Playstation), secondly, the game was now located on the CD -disk, which meant the impossibility of any hardware tricks. In short, the arrival of the Playstation put a section on two epochs — the one when crutches were considered good practice, and the one when crutches became considered crutches. But when one era replaces another, retrogrades always appear, sacredly honoring past covenants - it was thanks to their dedicated work that several games came to the market that work only on the earliest revisions of the Playstation. So, by changing the device port addresses from revision to revision, Sony engineers gently but persistently, let the developers understand that the official SDK and detailed documentation were given to them for a reason.
Programming for the Playstation was so simple that in addition to special hardware stations (Dev Unit), sold to professional game developers for about $ 35,000, Sony also released a special version of the console for home developers, called Net Yaroze, and comparable in cost to the console itself.
How was it done
We have already said that for early consoles, programming was carried out almost exclusively in assembler. In the case of the Playstation, the C language became the de facto standard for development. Normal C, without assembler inserts, connections to ports and any serious limitations, you no longer needed to write your own implementation of strncat or write your own library for I / O, if you just wanted to read the file from the disk.
Another important difference from the previous consoles was that the developer received a full-fledged API interface for all the console's hardware capabilities, such as a co-processor for vector computing. The SDK supplied by Sony had wrappers for everything that could come in handy, which made it possible to truly abstract from the features of the console. As a result, porting games from under DOS often turned around only by rewriting the layers responsible for graphics and sound.
In general, the development for a typical programmer was of this nature: a development module that connected to a computer was connected to the Playstation through the connector indicated in the figure. Through this bridge, an EXE file was loaded into the operating memory of the console, and through it the output of debug information to the computer was possible. Just as many homemade web studios are now experiencing a shortage of Apple technology to test their applications, the developers of the Playstation games lacked the Dev Unit. Thus, a large incomprehensible port on the back of the console should serve as a silent reminder that some things do not change even after almost two decades.

Of course, not every developer had enough self-control to write a game on the disgusted S. And then the ambitious developer’s weapon, the self-made programming language, was used. It is reliably known that at least 2 series of games suffered such a fate - Crash Bandicoot, which was written in the self-made dialect of lisp, as well as the entire Final fantasy line up to part 9, the engine of which migrated through a bunch of platforms and had its own interpretable assembler. About the creation of both games can be read here:
Crash Bandicoot:
http://all-things-andy-gavin.com/2011/02/02/making-crash-bandicoot-part-1/Final fantasy:
http://q-gears.sourceforge.net/gears.pdfHow it was done here
The significance of the Playstation is also in the fact that its discs could be read on any computer and recorded on it. What gave rise to the unprecedented wave of piracy for the other consoles. Now, in order to translate the game, it was enough to have a disassembler for the MIPS architecture, as well as a writing CD-ROM. Perhaps it is the fact that the translation of these games required so little to give rise to such a poor quality of the first translations. It can be regarded as an ideal illustration of the division of people into techies and humanities: when a person had enough knowledge of English exactly enough to study the reference book to the disassembler, we received a translation so richly flavored with jargon and obscenity that the game plot was somewhat lost; on the other hand, when the texts that were torn out by the debugger were sent to the translation by the student of philology, who wanted to earn some extra money, the output was so literary and cut off from the essence that a rare techie could understand exactly how to go through the described quest.
The other side of the relative ease of modifying the software code of games was the ability to collect several games on a single disc, to the joy of limited-media children. For the most popular games, coaches have been sewn in - loaders who have patched the decrement of lives, cartridges, etc. to death.
The Demoscene was surprisingly small and did not really form to this day. Therefore, I urge everyone who has anything to do with the piracy of console games to tell about it! I will be very grateful to those with whom I can talk on this topic in detail.
Gamedev features
Massively, games for the Playstation ceased to be released around 2002-2003, but enthusiasts do not give up and try to continue this noble cause. This can be done in two ways - just as many decent SDKs exist for the Playstation today. About where you can get both you can read at the end.
Psy-Q
This is the official SDK released by Sony for professional game developers. It contains the C compiler, as well as all the necessary libraries. There are also many tools for processing graphics and bringing it to a format suitable for processing the Playstation, some of the tools are already useless due to the presence of modern analogs, some exist incomprehensibly for what - the documentation for them is lost.
This SDK really allows you to write high quality games, but it has one drawback - it is designed to work under Windows 95-98, you can run into problems already on XP. But even with it, the creation of games that use 3D models will be difficult - in those times, rather specific 3D editors were used, and the SDK contains only a tool for converting models from formats of many years ago.
In general, this SDK is worth trying just to understand what the programmers of the time had to work on and how imperfect their tools were compared to today.
PSXSDK
Since 2008, a fully open SDK, based on the GCC compiler, has evolved to this day. It allows you to create only 2D games - well, or if you feel strong enough to write an engine for 3D rendering in C, then all roads are open to you. Write a video player on it will also be problematic, but in general it is the best option to start programming.
From pleasant advantages - with the help of this SDK you can compile such things as gzip, libpng, etc. - any modern plain C code. So the author managed to compile earlier versions of Lua to work on the Playstation. Therefore, if you know any library designed for work in microcontrollers that implements basic work with 3D graphics such as rendering polygons or mapping textures, then this will be a good help for the project.
The documentation is currently being written by me, and in my free time. But there are code examples, using which, it is more than possible to write your own Super mario or an analogue of almost any flash game.
In addition, this SDK works successfully under both Windows and Linux. Yes, what a sin to confess - under all under which you can only collect it.
Community
The community of enthusiasts is divided into 2 groups, depending on the use of the SDK. At the same time, the group that uses Psy-Q has a more “iron” focus, like modding consoles. In this way, the dispersed efforts of an already small number of people occur. The habitats of members of both communities also vary:
Psy-Q:
irc: irc.eversible.com #psxdev
forums:
http://psxdev.net/PSXSDK:
irc: irc.freenode.net #unhaut
forums:
http://unhaut.fav.cc/forumsproject website:
http://code.google.com/p/psxsdkIf you know any Russian-speaking communities involved in developing for Playstation or translating games, or did you translate these games in due time, or did you have any tools or documentation from people you knew and who did it? please, write to me! Moreover, if you have information about device-independent C-libraries for rendering 3D-graphics, which are also undemanding of resources, then again - write!