📜 ⬆️ ⬇️

How to write games on Dendy


In this article, I would like to shed some light on how games were created on Dendy. And it will not be about how it can be done now, but how it happened then - in the 80s and 90s, and about what problems the developers faced at that time. If you are bored with reading the next memoirs of managers, designers, or programmers who turned into managers who reveal the technical side of things a little less than nothing, then welcome to cat.


Then and now

Nowadays, development for game consoles is increasingly reminiscent of writing programs for ordinary computers, the difference between what was going on then and what today's developer has is enormous. On the one hand, today, technology and development culture have made great strides forward, allowing development in high-level languages, on the other - in the 80s, consoles have not fully understood what to give third-party developers to create games. And so if now for the next playstation you can get documentation, heels of demo disks, as well as a powerful developer station, essentially a hybrid of the console itself and a general-purpose computer suitable for direct development, for example, in the 80s many developers were content with a little book with the console specification . But the hardware had to go to the radio market (or what was there in the states instead of them?).


A bit of history

It is believed that the Nintendo Entertainment System (NES) was originally created, with which our Dendy and dozens of other clones around the world have already been coiled.
')


After looking at the picture you can see that this may not be quite so. Initially, in Japan in 1983, the Famicom console was still released. In any case, there were 2 slightly different console - NES and Famicom. And the development for them was also carried out by different tools, although the software code of games in the cartridges for both was the same. Cartridges themselves were somewhat different. In the case of NES, there were several additional contacts on the cartridge, which led to the chip, which in theory was supposed to be only on licensed cartridges ...

Back in 1983, Nintendo could only dream of third-party developers for the new console. So the first few games were created by the authors of the console themselves. Some of them were ports of games that already existed on arcade machines. These games were distinguished by primitiveness even by the standards of NES, without using all the possibilities of its hardware stuffing. All games of that starting period fit on one screen and did not occupy more than 32 kilobytes of data on the cartridge. The most famous games of the period: Donkey Kong, Balloon Fighter, Mario Bros. The irony was that NES had special hardware support for scrolling levels, but the very first side-scroller games were not, although they were released by a company that God himself ordered, knowing all the features of their console, to release games that maximize the benefits of the new console .

The limit for the size of 32 kb NES-games took place only the first couple of years. Then, third-party developers more or less adapted themselves to the console and realized that 32 KB would not be enough for everyone. Seeing this situation, Nintendo decided to make a mapper for all the new cartridges, which made it possible to create games an order of magnitude larger. It should be noted here that the architecture of the NES itself has not changed, but the cartridges have changed, expanding the capabilities of the NES itself.

On the cartridge, you could shove anything — any chips that your heart desires: RAM, video memory, a coprocessor, non-volatile memory for saving. Theoretically, you can add things like a modem or raspberry pi to a cartridge. Another thing is that to implement this will require titanic efforts, as well as several free days off.


Cartridges

The specifications of the NES cartridge can still be found on the Internet, and, in general, are analyzed in some detail by the community. But the process of producing cartridges is a mystery covered in gloom. It is more or less reliably known that in Europe and the USA only Nintendo was engaged in the release of cartridges. In the sense of the boxes themselves with the chips.

The chipset has increased over the years, so one can say that, from the developer’s point of view, the specification of the console itself has changed, although in fact the cartridges have changed. This feature has allowed NES to be popular for so long, competing with other game consoles.

Each developer had to explicitly indicate in the header of the compiled game (ROM) the list of NES functions to be used by the game. Some functions were supported by “regular” cartridges - for example, a memory mapper, but for the presence of storage or excess RAM, Nintendo had to pay extra to include the cherished chips in your future cartridge.

In Japan, there were companies that themselves were engaged in the manufacture of cartridges, simultaneously adding to them their own unique chips, created for one particular game. Subsequently, such things in themselves ate a lot of nerve cells from those who created the NES emulators, trying to get to work in their offspring and such games.

The architecture of the cartridges meant that the program itself and the graphic sprites are in different chips. For example, a photo of a Super Mario Bros. cartridge.



In those cartridges that were sold here, these chips were usually used only in those that came with the console, and not always. In the pirate cartridges used black blotches instead of chips, most likely it was the same schemes, but made using a different technology. For what? I think in the comments you will find the answer to this question.


Development Equipment

Information about the official SDK from Nintendo is very scarce, so much so that I am already inclined to believe that it simply did not exist. Those. There are a couple of photos of such units in the network, but nowhere is it said that they were released by Nintendo, moreover - their appearance suggests that these were probably crafts of end developers. So all that was available was the specifications, and then each developer was spinning as best he could. Self-made equipment for the development was divided into 2 classes: modified cartridges with rewritable data banks and debugging stations.

In the first case, everything is relatively simple - in a conventional cartridge, the data banks and graphics were replaced with similar chips with the possibility of multiple rewriting. It’s not to say that development with such a tool pleased me: after each recompilation, the cartridge had to be reinstalled. And yes, despite the small amount of programs, the speed of the firmware was small, considering the hardware and power of computers of that time. Nevertheless, this device in several copies was the same and often the only tool of the programmer.

In the case of RAM cartridges, development went much faster. It was possible to edit the memory during the game, using the computer on which, in fact, the development was carried out. The EEPROM chip was replaced with banks of RAM, which on the one hand were seen as a console by a console, and on the other hand were connected to a developer’s computer and were normal RAM for it ... or a disk ... or a device - it all depended on which driver the programmer wrote for his brainchild.

The most stubborn or successful developers could boast of debugging stations - modified NES, which, in addition to all the advantages of RAM-cartridges, also provided an opportunity to carry out deep debugging, viewing the contents of video memory, processor registers, etc. Here, for example, one such station.



It is unknown on which computers the development took place, but considering the level of fuss with radio components that was required to run the debug version of the game on the console, the computer model did not have special significance. It is known that Japanese developers used MSX computers . With high probability we can say that Apple 2 computers were used in the USA due to the fact that they were quite common, and also had a processor similar to that used in NES.


Software

The main and almost the only programming language used for game development is assembler, some lucky ones wrote in C if they could get a compiler. But even in this case, some firms did not buy an assembler from Nintendo and wrote their own. What caused this was hard to say, but many sources say that in the early years of NES, Nintendo did not share its tools with third-party developers.

The processor that was used in NES was also found in computers like Apple 2 or Commodore 64, for which there were both assemblers and even C compilers. But the NES architecture still had some differences, and wild system limitations and the presence of banking (the need to unload old and loading new pieces of software code into an area accessible by the processor) did not allow to write games on C that would use the maximum capabilities of the console.

Assembler is far from the only thing that you had to write by hand: graphics editors, programmers, debuggers: all this was written several times by caring hands of programmers. Map editors can be considered as a separate article - it should be remembered that computers were weak and short of memory, so, for example, the entire map for Metroid was drawn by hand on paper and then encoded into pieces in pieces.


Development process

The developers often recruited yesterday's students who did not see the NES in the eye. For the lion’s share of small companies creating games, the term “sharashkina office” was the best suited. A typical game took 3-6 months to develop. The teams most often were small - 3-10 people. There were many offices that released 1 game and then disappeared without a trace.

The development process usually began with the creation of development tools. Although the concept of the game by the time it was ready. And in general, in the early years, many NES games were ports from arcade machines. Even if the programming of the game itself has not yet started, the composer and the artist took up the task. Almost all the music and all the graphics for the dendiv games were not made on the computer.

First, the designer sketched backgrounds and characters, then, after selecting suitable drawings, the so-called pixelation started - the NES palette supported only 14 colors on the screen at a time, so you had to repaint the drawings taking into account this restriction. Then the drawing was drawn on the grid, and, if necessary, stretched or compressed - NES hardware supported sprites of 8x8 pixels. Mario's character was painted in 4 passes, after eating a mushroom - in 8 passes. A trifle, but sometimes because of its ignoring, we saw in some games missing sprites, when there were a lot of enemies on the screen, so programmers had to save on matches. By the way, there were 2 types of video memory - one in which character sprites and other small things were usually kept, the second one, which contained more level maps. The latter was located in a separate address space and supported hardware accelerated scrolling operations.

The work of the composer smoothly flowed into the work of the programmer - to write music is only part of the story, to code it into a game is also gainable, and then the most interesting thing began. As mentioned above, sometimes the game slowed down, so if in the pre-release such brakes reached unprecedented performance, the composer was given the task of “optimizing” the music — removing the extra opcodes to speed up the game as a whole. And then it turned out the true skill of the composer. The extra coin in the piggy bank of the composer’s shame was added by the fact that not always the game developer on the film received a license to ... use the music from the film. Thus, composers had to write something original, and not always good.

Among the games for the NES, the so-called repackage was common - it is when, on the basis of one game, they do another by changing sprites and levels, sometimes changing the gameplay itself. For example, Castlevania and Ninja Gaiden are made on one engine, just like Darkwing Duck was made on the basis of the engine for the Megaman (Rockman) game series. What were the true scales of repackage, we can only guess, especially given the fact that a huge percentage of dandy games are side-scrollers of the same type.


Developers

As already mentioned, many of them were students yesterday. At that time there were a lot of architectures, so knowledge of at least some kind of assembler was often enough for taking to work. A large stream of personnel migrated from the cohort of programmers of arcade game machines. It is very easy to distinguish the latter from interviews - every time they try to justify themselves by the NES system restrictions that they faced after the platform change. And the truth is that NES was not created at the cutting edge of technology of its time, it was inferior to the hardware that was placed in slot machines. But it cost less money to customers and more frustration to programmers. A good explanation of the limitations of NES in terms of the final programmer can be seen in this video: http://www.youtube.com/watch?v=Hvx4xXhZMrU .

Of course, I was interested in what exactly the developers did in those days, but alas, it was this question that remained unanswered. Programmers do not remember a damn period. Those. they remember some organizational issues, difficulties encountered in the team, how they ate pizza on weekends, how they quickly looked for a job as a programmer for NES to pay off their debts, but they could not name the brand of computer for which they spent sleepless nights. And in general, we can say that their work was perceived as a routine, they did not have the feeling that they create great things that will remain in the memory of a multi-million generation for life.

Only later, years later, they began to understand the significance of what they wrote. And then they became really ashamed. They could be understood - the zoo of consoles of that time, the vagueness of their future, micromanagement in development - all this created the impression that you were writing something incomprehensible, not clear why, and not clear with what prospects.

Among the companies, as mentioned above, there were a lot of one-day events - such as those that now write games for iPhones that tried themselves in this market, went bankrupt, went into oblivion. A huge number of Roma dendivs in general does not contain any information about the developers, which indicates a very low assessment of the results of their work on the part of programmers.

Surprisingly, there are those that still continue to develop games, even after 30 years. They can be found in social networks, but after the second dozen attempts to reach at least one of them failed, I gave up this useless exercise. But a list of the names of the developers that I managed to tear out of the most extensive collection of rums is here .


Today

Nowadays, a lot of people write games for NES, but this is not at all the case - 99% program their examples exclusively for the emulator, without thinking about creating cartridges. Even not, better this way: today programmers have emulators with a built-in debugger, ready-made macro assemblers and C compilers, a number of sprite editors and music created by the community. The site nesdev.com contains everything to do this hard work. Or at least you should look at the Wiki section on this site to find out how much you did not know about Dandy.

So today, a student can create a game for Dandy who has written and not bought the code for his laboratory on the subject of microcontroller programming.


Conclusion

Judging by the fragmentary information that was obtained on the development of that era, for almost 30 years nothing has changed. And the process of creating games on Dandy in 1985 differs little from the creation of casual toys for smartphones today. If someone has more detailed information, I’ll be happy to add it to the article. You can also google and ask programmers from the list, maybe luck will smile more to you. And if you, God forbid, you are riveting now toys for an iPhone, PSP, or assorted tablets - keep a diary, after 20 years it will be necessary for someone.

Source: https://habr.com/ru/post/200612/


All Articles