DIY dandy game console. How it's made, how it works, how it works. Modern developments for the NES

This post is an introduction to my project of a “homemade” video console made from scratch. I was inspired by both retro consoles and modern designs, but I came up with my own architecture. My friends constantly told me that I should talk about my project, and not do everything exclusively “for myself,” so here I am publishing this post.

Attention, this is a translation

My name is Sérgio Vieira, I grew up in Portugal in the 80s and 90s, I have long had a nostalgia for retro gaming, especially third and fourth generation consoles.

A few years ago I decided to understand electronics better and try to make my own set-top box.

I am a programmer by profession and had no experience as an electronics engineer, except (and this should not be counted) for independent upgrades of my desktop computer.

Although I had no experience, I said to myself “why not?”, bought several books, several electronics kits and began to study based on my feelings about what exactly was worth studying.

I wanted to make a console similar to those that give me nostalgic feelings, I wanted something between the NES and the Super Nintendo, or maybe between the Sega Master System and the Mega Drive.

These consoles had a CPU, an original video chip (they weren't called GPUs back then) and an audio chip, sometimes built-in and sometimes external.

Games were distributed on cartridges, which were generally extensions of the hardware, sometimes just ROM chips, and sometimes had additional components.

The original plan was to make a console with the following characteristics:

  • Without emulation, games and programs must run on real hardware, not necessarily the same hardware from back in the day, but fast enough for the task and nothing more.
  • With a real retro CPU.
  • With analog TV output.
  • With sound
  • Supports two controllers
  • Scrolling backdrops and sprite animation
  • With capabilities to support platform games like Mario, and of course all sorts of other games.
  • With loading games and programs from SD cards.

Why SD cards and not cartridges, well, basically it’s just much more practical, they can be copied from a computer. And cartridges would mean, firstly, more hardware in the console, and secondly, the production of hardware for each program.

Video signal

The first thing I did was generate a video signal.

Any console from the period I sampled had different proprietary graphics chips, meaning they all had different specifications. For this reason, I did not want to use an off-the-shelf graphics chip; I wanted my console to have unique graphics specifications. And since I could not make my own graphics chip, and at that time did not yet know how to use an FPGA, I decided to limit myself to software generation of the graphics signal using an 8-bit, 20 megahertz microcontroller.

This is not overkill, and just a powerful enough solution for graphics of the level that was interesting to me.

So, I started using the Atmega644 microcontroller at 20 MHz to generate a PAL video signal for the TV. I had to bit-ban the PAL protocol, since the chip itself does not support it.

The microcontroller produces 8-bit color (RGB332, 3 bits red, 3 bits green and 2 bits blue) and the passive DAC converts it all to RGB. Luckily in Portugal almost all TVs are equipped with a SCART connector and they support RGB input.

Making AV-mod for Dandy

Although this attachment has outputs for tulips, their central contact is soldered to the ground, that is, they are not used, you need to carefully separate the central output from the earthen path with a stationery knife, in the photo I have outlined the areas where you need to cut with a pen.


Dendy conversion: video amplifier, AV-mod, RF module and sound


Dendy conversion: video amplifier, AV-mod, RF module and sound

Correct graphics subsystem

Since the microcontroller is quite powerful, and I decided to use it exclusively to generate a video signal (I called it VPU - Video Processing Unit), I decided to organize a double buffer at the same time.

It turned out that the second microcontroller (PPU, Picture Processing Unit, Atmega1284 chip, also at 20 MHz) generated a picture into RAM chip number 1 (I called it VRAM1), and the first at the same time sent the contents of the second chip (VRAM2) to the TV.

After one frame, and two frames in the PAL system is 1/25 of a second, the VPU switches VRAMs and they change places, the PPU generates a picture in VRAM2, and the VPU dumps VRAM1 to the TV output.

The video board turned out to be very complex because I had to use external hardware so that both microcontrollers could use both memory modules and to speed up access to RAM, because there is also bit banging, so I had to add 74 series chips as counters, line selectors, transceivers, etc. .

The firmware for VPU and PPU also turned out to be cumbersome because we had to write a lot of code to squeeze maximum speed out of the graphics. At first everything was written in assembler, then some was rewritten in C.

As a result, the PPU generates a 224x192 pixel image, which is then sent to the TV via the VPU. The resolution may seem low to you, but actually it's almost as high as the consoles of that time actually had, usually 256x224. A slightly lower resolution allowed me to add more features that the system can calculate in one frame.

Just like in the old days, PPU has its own tough mechanics that you need to know how to use. The background (back) is rendered from 8x8 pixel characters, also called tiles. It turns out that the size of the background is 28x24 tiles.

So that the back could scroll smoothly, pixel by pixel, I made it so that there are 4 virtual screens in total, each with 28x24 tiles that go in memory sequentially and are wrapped around each other, this is clearer in the picture.

On top of the background, the PPU can render 64 sprites that can be 8 or 16 pixels in height or width, that is, 1, 2 or 4 tiles and can also be flipped horizontally and/or vertically.

On top of the back, you can also render one buffer of 28x6 tiles as an overlay; this was intended for drawing HUDs and speeds so as not to interfere with the main sprites and scrolling of the back.

One “advanced” feature is that the back can be scrolled not entirely, but each line separately, which allows for all sorts of interesting effects like split screen or almost-parallax.

There is also an attribute table that allows you to set each tile a value from 0 to 3, and then you can set all tiles with one attribute to a page of tiles or increment their symbolic value. This is convenient when there are parts of the backing that need to be changed regularly and the CPU does not have to calculate each tile separately, it just needs to say something like: “all tiles with attribute 1, increment the numerical value of your symbol by 2”, similar things can be implemented using different techniques observe, for example, in block tiles in Mario where the question mark is animated or in games where there is a waterfall in which all the tiles are constantly changing creating the effect of falling water.

Why exactly 40 kilobytes?

In the 1980s, the amount of memory on digital devices was measured in kilobytes, because such advanced memory technologies did not yet exist. Most cartridges for eight-bit consoles had 40 kilobytes of memory. For comparison, this is one hundred thousand times less than on a 4 gigabyte flash drive. Even this article weighs more than 40 kilobytes, so by modern standards this is really not enough.


Two memory blocks in cartridges, 8 and 32 kilobytes, for a total of 40 kilobytes.

To use more memory, it was necessary to use all sorts of tricks - install memory expanders or separate units to work with several cartridges at the same time. Since almost no gamers had such luxury, the developers used only 40 available kilobytes.

What kind of memory is there?

When you have little memory, you have few options: the levels are monotonous, the enemies are the same, the gameplay is the same. But sometimes the developers resorted to crazy tricks, and they managed to cram a lot of “worlds”, secrets and gameplay options into the game.

One of the games that blew everyone’s minds at the time was that same “Super Mario”: it had a huge number of different levels of varying difficulty, bosses, secret levels and challenging, very intense gameplay. There were levels on the ground, underground, under water and even in the sky; the hero had several modes - low, high, in a white jumpsuit. What do you think of the idea of ​​a destructible world? How do you like air attacks? In short, Mario was a crazy, incredible game for its time, all thanks to optimizations.

In the video, the developers set themselves a similar goal: to make a rich, varied game with a large number of levels, worlds and moods. And they showed how to achieve this using tough optimizations.


“Super Mario” is a game that everyone who had a console played.

CPU

When my video card started working, I started working with the CPU, which was Zilog 80 for my set-top box.

One of the reasons why the Z80 was chosen, well, besides the fact that it is a cool retro CPU, is its ability to address two 16-bit spaces, one for memory and the second for I/O ports, the no less legendary 6502, for example, cannot do this , it can only address one 16-bit space and you have to map both memory and various external devices, video, audio, joysticks, hardware random number generator, etc. into it. It is more convenient to have two address spaces, one completely dedicated to 64 kilobytes of code and data in memory, and the second for accessing external devices.

First, I connected the CPU to the EEPROM in which my test program was located and also connected it through the I/O space to the microcontroller that I installed so that I could communicate with my computer via RS232 and monitor how the CPU and everything else was working. I call this Atmega324 microcontroller operating at 20 MHz IO MCU - input/output microcontroller unit, it is responsible for controlling access to game controllers (joysticks), SD card reader, PS/2 keyboard and communicator via RS232.

The CPU is connected to a 128 kilobyte memory chip, of which only 56 kilobytes are available, this is of course nonsense, but I could only get 128 or 32 kilobyte chips. It turned out that the memory consists of 8 kilobytes of ROM and 56 kilobytes of RAM.

After that, I updated the IO MCU firmware using this library and I now have support for SD card reader.

Now the CPU could walk through directories, see what was in them, open and read files. All this is done by writing and reading to specific addresses in the I/O space.

Roadmap for assembling Dendy with your own hands

The diagram, if anyone has read to the assembly stage) To open in full expansion, on the image that opens, right-click - open in a new tab and then left-click +.

First thing

We solder the 60-pin connector and check how all its 60 contacts ring along the tracks to the places where each contact arrives. Almost half leads to CPU, the other half to PPU. Power supply and outputs from the generator.

Second thing

We are putting together a power supply diagram. Power connector, diode bridge, stabilizer with radiator, capacitors before and after the stabilizer, power button and reset button. We supply power and check all the last legs on all microcircuits for the presence of a stable supply of +5 volts. The last leg of the chip is +, the minus is on the opposite side at the end of the chip.

Third thing

We assemble a circuit for a sound amplifier and image output. After assembly, you can check the functionality of the cascade by touching the outputs of the left and right channels from the CPU, pins 1 and 2. When you touch them with your hand, a quiet noise should appear at the output of the audio amplifier. On your TV, if you have connected the red and white output to the audio input)

By touching the outputs from PPU pin 21 on the TV when the yellow cable is connected to the video input, small ripples will appear.

Fourth thing

We solder all the parts and carriages for the microcircuits onto the board. We check each soldered part three times: the nominal value, how it was soldered, and we rang it in place.

Connecting CPU to PPU

The next thing I did was the communication between the CPU and PPU. To do this, I used a “simple solution” which consisted in purchasing a dual-port RAM, this is a RAM chip that can be connected to two different buses at once. This allows you to get rid of additional chips like line selectors and, moreover, allows almost simultaneous access to memory from both chips. The PPU can also directly access the CPU on each frame by activating its non-maskable interrupts. It turns out that the CPU receives an interrupt on every frame, which is useful for various timing tasks and for understanding when it’s time to update the graphics.

Each frame of interaction between the CPU, PPU and VPU occurs according to the following scheme:

  1. The PPU copies information from the PPU memory to the internal memory.
  2. The PPU sends an interrupt signal to the CPU.
  3. Simultaneously:
      The CPU jumps to the interrupt function and begins updating the PPU memory with the new graphics state. The program must return from the interrupt before the next frame.
  4. The PPU renders the image based on information previously copied to one of the VRAMs.
  5. The VPU sends the picture from another VRAM to the TV output.

Around the same time I started supporting game controllers, at first I wanted to use controllers from Nintendo, but the sockets for them are proprietary and generally difficult to find, so I settled on 6-button controllers compatible with Mega Drive/Genesis, they have standard DB-9 sockets which are everywhere.

Installing the operating system on the game console

Installation of the gaming system on an already running Raspbian is done through the terminal. We’ll leave this for the future; now we’ll try the option for beginners. All the emulators described above are installed in the same way.

To get started, I recommend trying RecalBox . Here is the most clear and user-friendly interface, the setup is extremely simple, most of the features are included out of the box, and as a bonus we get the KODI , which can easily replace a budget TV set-top box for watching movies from a flash drive, over the network or online.

1. Download the selected image from the developer’s website.

2. Download and install the Etcher application to write an image to a memory card.

3. We write the image to the memory card.

4. After finishing recording, install the memory card in the Raspberry and connect it to the TV.

During the first launch, the system will be installed and the initial configuration will take place. Nothing is required from the user, we just wait a few minutes before the visual shell starts.

The system will immediately prompt you to configure the joystick. This can be either a USB accessory or a wireless one. It is better to have a keyboard at hand in order to make all the settings in case of problems connecting the gamepad.

Adding dynamic graphics

Everything was super, I had my own game console, but this was not enough for me, because in the game I had to use graphics flashed in the PPU memory and it was impossible to draw tiles for a specific game and it could only be changed by flashing the ROM. I began to think about how to add more memory so that the CPU could load symbols for tiles into it, and the PPU could then read it all from there and how to do it more simply since the console was already complex and large.

And I came up with the following: only the PPU will have access to this new memory, and the CPU will load data there through the PPU and while this loading process is happening, this memory cannot be used for drawing, but it will be possible to draw from the ROM at this time.

After the end of loading, the CPU will switch the internal ROM memory to this new memory, which I called Character RAM (CHR-RAM) and in this mode the PPU will start drawing dynamic graphics, this is probably not the best solution, but it works. As a result, the new memory was installed at 128 kilobytes and can store 1024 characters of 8x8 pixels each for the background and the same number of characters for sprites.

Correction of the power stabilizer circuit, change to KREN-ku (7805)

I noticed that in this Dandy clone there is a transistor with a zener diode, a couple of resistors and capacitors as a 5V power stabilizer, this is not a very good circuit and it is advisable to replace it with a 5V stabilizer chip - 7805. We take the stabilizer circuit, as well as the video amplifier circuit , sound output with a resistor divider exactly like the Dendy Junior game console and everything will work perfectly as always.


Dendy conversion: video amplifier, AV-mod, RF module and sound


Dendy conversion: video amplifier, AV-mod, RF module and sound

Dendy conversion: video amplifier, AV-mod, RF module and sound

Dendy conversion: video amplifier, AV-mod, RF module and sound

I drew a diagram of the stabilizer that originally came from the factory (it’s in the notebook below) and on top of the one we will convert to, on the 7805 chip. Now we’ll solder this circuit instead of the old one, which needs to be desoldered before that, the tracks will also have to be cut somewhere, and where -to add, the 7805 stabilizer is soldered on the wires, a radiator should also be attached to it for cooling.


Dendy conversion: video amplifier, AV-mod, RF module and sound

And finally the sound

The hands reached the sound last. At first I wanted a sound similar to what is in Uzebox, that is, for the microcontroller to generate 4 channels of PWM sound.

However, it turns out that I can easily get hold of vintage chips and I ordered some YM3438 FM synthesis chips, these guys are fully compatible with the YM2612 used in the Mega Drive/Genesis. By installing them you can get Mega Drive quality music and sound effects produced by the microcontroller.

I installed another microcontroller and called it SPU (Sound Processor Unit), it controls the YM3438 and can generate sounds itself. The CPU controls it through dual-port memory, this time it is only 2 kilobytes.

Like the graphics block, the sound block has 128 kilobytes of memory for storing PCM samples and sound patches, the CPU loads data into this memory by accessing the SPU. It turns out that the CPU either tells the SPU to execute commands from this memory or updates the commands for the SPU every frame.

The CPU controls four PWM channels through four circular buffers located in the SPU memory. The SPU passes through these buffers and executes the commands written to them. There is also one such buffer for the FM synthesis chip.

In total, as in the graph, the interaction between the CPU and SPU proceeds according to the diagram:

  1. The SPU copies data from the SPU memory to the internal memory.
  2. The SPU is waiting for an interrupt signal from the PPU (this is for synchronization)
  3. Simultaneously
      The CPU updates the PWM channel buffers and FM synthesizer buffers.
  4. The SPU executes commands in buffers according to data in internal memory.
  5. At the same time as all this, the SPU updates the PWM sounds at a frequency of 16 kilohertz.

After all the blocks were ready, some went to breadboards. For the CPU block I was able to develop and order a custom PCB, I don’t know if it’s worth doing this for the other modules, I think I was actually lucky that my PCB worked right away.

On the breadboard now (for now) there is only sound left. Here's what it looks like today:

Characters

The game has two types of graphics: a static background and moving objects - players, opponents, bosses and shots. Anything that moves is called sprites. The developers divide all graphics memory into two parts - one for sprites, the second for the background:


Each cell is a mini-square 8 by 8 pixels.


In each such square you can draw something, but use only three colors.


If you combine several squares into one, you get a metasprite. In our case - a character.


The console can only use 4 types of palette at a time, so we end up with 4 colored main characters and an uncolored villain. New limitation: only 8 sprites can be on the screen at a time - there is not enough memory for more. Therefore, there is no room left for the villain. You can use a trick and show them quickly, one after another, but then the picture will flicker and look worse.


The developers radically reduced the size of the heroes and villain to one sprite. Now they look more conventional, but they fit on the screen.


Smaller hero size means more space for designing villains, bosses and special effects. Now the table contains all the options for how a character can look in the game - both jumping and running.

Architecture

The diagram illustrates the components in each block and how they interact with each other. The only thing that is not shown is the signal from the PPU to the CPU on each frame in the form of an interrupt and the same signal that goes to the SPU.

  • CPU: Zilog Z80 at 10 MHz
  • CPU-ROM: 8KB EEPROM, contains bootloader code
  • CPU-RAM: 128KB RAM (56KB available), code and data for programs/games
  • IO MCU: Atmega324, is the interface between the CPU and RS232, PS/2 keyboard, joysticks and SD card file system
  • PPU-RAM: 4 kilobytes of dual-port memory, intermediate memory between the CPU and PPU
  • CHR-RAM: 128KB RAM, stores dynamic tiles for the background (background) and sprites (in 8x8 pixel characters).
  • VRAM1, VRAM2: 128KB RAM (43008 actually available), used for framebuffer, PPU writes to them and VPU reads from them.
  • PPU (Picture Processing Unit): Atmega1284, draws the frame into the framebuffer.
  • VPU (Video Processing Unit): Atmega324, reads the framebuffer and generates RGB and PAL signal and synchronization.
  • SPU-RAM: 2KB dual-port RAM, serves as an interface between the CPU and SPU.
  • SNDRAM: 128KB RAM, stores PWM patches, PCM samples and instruction blocks for the FM synthesizer.
  • YM3438: YM3438 FM synthesis chip.
  • SPU (Sound Processing Unit): Atmega644, generates sounds using the principle of pulse-width modulation (PWM) and controls the YM3438.

Correcting the operation of the RF module, removing interference

As you can see, initially the video signal from Dandy’s RF module to the TV is very noisy, there is a lot of interference in the form of snow and distorted colors. Everything is simple here, you need to shield this part, just make a metal casing on top of the entire module and connect it to the power supply minus. But before this, it is better to fill all frameless coils with paraffin so that the frequency does not go away, since if you touch the coil a little, the signal disappears.


Dendy conversion: video amplifier, AV-mod, RF module and sound

Also, when you subsequently add a video amplifier, the video signal to this radio module will be more powerful and the picture quality will noticeably improve, you will see this later (even in the end the screen was not needed).

Final Specifications

CPU:

  • 8-bit CPU Zilog Z80 at 10Mhz.
  • 8KB ROM for bootloader.
  • 56KB RAM.

IO:

  • Reading data from FAT16/FAT32 SD card reader.
  • Read/write to RS232 port.
  • 2 MegaDrive/Genesis-compatible game controllers.
  • PS2 keyboard.

Video:

  • Resolution 224x192 pixels.
  • 25 frames per second (half FPS of PAL).
  • 256 colors (RGB332).
  • 2x2 virtual background (448x384 pixels), with bidirectional pixel-by-pixel scrolling, based on four full-screen pages.
  • 64 sprites with a width and height of 8 or 16 pixels with the possibility of both vertical and horizontal flip.
  • The background and sprites consist of characters of 8x8 pixels each.
  • Character video memory with 1024 characters for background and 1024 for sprites.
  • 64 independent horizontal scrolling along specified lines
  • 8 independent vertical scrolling along specified lines
  • Overlay 224x48 pixels with optional color key transparency.
  • Background attribute table.
  • RGB and composite PAL via SCART connector.

Sound:

  • PWM 8 bits and 4 channels, with built-in waveforms: square, sine, saw, noise, etc.
  • Samples at 8 bits, 8 KHz in one of the PWM channels.
  • YM3438 FM synthesis chip loaded with instructions at a frequency of 50 hertz.

A bootloader was written for the console. The bootloader is placed in the CPU ROM and can occupy up to 8 kilobytes. It uses the first 256 bytes of RAM. The bootloader is the first thing the CPU executes. It is needed to show programs located on the SD card.

These programs are found in files that contain compiled code and may also contain graphics and sound.

After selecting a program, it is loaded into CPU memory, CHR memory and SPU memory. After which the program code is executed. The maximum size of the code loaded into the console is 56 kilobytes, except for the first 256 bytes, and of course you need to take into account the space for the stack and data. Both this bootloader and other programs written for this console were created in the same way as described below.

Select the operating system on which the console will run

After selecting the components, you should decide on the operating system of the future console. At the moment, there are three good assemblies that are suitable for our task:

  • Lakka
  • RecalBox
  • RetroPie

Lakka is a build with a beautiful PlayStation-style visual interface. The project is developing rather slowly, Lakka still has many glitches and shortcomings. ‎ RecalBox is a more advanced all-in-one solution. After installation, the image will already contain a couple of dozen classic games for different platforms. In addition, the KODI . In a couple of clicks, you can turn your gaming console into a media processor for playing video from a removable drive, from the Internet or network storage. It is possible to set up IPTV.

RetroPie is another multifunctional emulator of old game consoles. Initially, the image does not include games and there is no media player like KODI, however, it is possible to install RetroPie on top of the native operating system for Raspberry - Raspbian . This means that the gaming service can work on Malinka simultaneously with other services, for example, with HomeBridge, which connects smart gadgets in the house.

The choice is between the last two options. RecalBox is a simple image with games out of the box and the KODI media center, and RetroPie is for those who want to tinker and install the system on top of Raspbian.

Memory/IO Mapping

What is important when developing for this console is to take into account how the CPU accesses various blocks, and correctly distribute the input/output address space and memory address space.

The CPU accesses the bootloader's RAM and ROM through the memory address space.

Memory address space

And to PPU-RAM, SPU-RAM and IO MCU through the I/O address space.

I/O address space

As can be seen from the table, within the I/O address space, addresses are allocated for all devices, IO MCU, PPU and SPU.

Setting up a gamepad (joystick)

The gamepad needs to be configured only after you have installed the emulator you need. The media center has built-in drivers and can work with almost all known joysticks.

To configure your gamepad, open Settings, then System. Connect your device and go to the “Input” section, after “Setting up connected controllers”:

Select your joystick type and configure the button values:

That's all. As you can see, everything is simply outrageous. Did you think that your Smart TV is capable of being a game console?

If you have any questions, write in the comments and together we will solve everything.

To bookmarks

Perhaps many people have an old laptop or an obsolete computer. It’s a pity to throw away such a unit, and you won’t get any money from it on the private classifieds site.

Instead of leaving the old man collecting dust in the back corner of the closet, it can be perfectly adapted to a retro console. In this article I will talk about my own experience of turning a well-worn laptop into an excellent simulator for Sega, Dendy and PS1.

PPU management

From the information in the table it is clear that to control the PPU, you need to write to the PPU memory, which is available at addresses 1000h-1FFFh in the I/O address space.

PPU Address Space Allocation

PPU Status can take the following values:

  1. Embedded graphics mode
  2. Dynamic Graphics Mode (CHR-RAM)
  3. CHR memory recording mode
  4. Recording is complete, we are waiting for confirmation of the mode from the CPU

Here, for example, is how you can work with sprites: The console can draw 64 sprites at the same time. Data on them is available via the CPU through the I/O address space at addresses 1004h-1143h (320 bytes), each sprite has 5 bytes of information (5 * 64 = 320):

  1. A byte of different flags, each bit of this byte is a flag: Active, Flipped_X, Flipped_Y, PageBit0, PageBit1, AboveOverlay, Width16, Height16.
  2. Character byte, character number from the table (defined by the flags above).
  3. Color key byte (that is, what color is transparency)
  4. X coordinate byte
  5. Y coordinate byte

In total, to see the sprite, you need to set the Active flag to 1, and set the X and Y coordinates within visibility, coordinates 32/32 place the sprite in the upper left corner of the screen, lower values ​​will hide it or make it partially visible.

Then we can set the character code and transparency color.

For example, if we need to show sprite number 10, then the address will be 4145 (1004h + (5 x 9)), write the value 1 for activation and coordinates, for example, x=100 and y=120, write the value 100 to address 4148 and address 4149 value 120.

Drawing maps (and optimizing them)

Even the 60 bytes per screen that we got is still a lot, because we need to make a lot of different maps, write the logic of character behavior and make menus, screensavers and credits. Every byte counts.

The first option is to reduce the amount of memory for drawing the map: make them symmetrical, which will give us 30 bytes instead of 60. We draw one half of the map, and then simply mirror it. Let's compare with the card we would like to receive:


Everything seems to be in place, but it looks bad - the symmetry is immediately visible and access to the top is blocked by blocks.

And here the developers make another clever move that will give them a little extra memory for graphics. See:

  1. They provide one byte for storing one supertile.
  2. They count from the picture how many super tiles they got in the last section - 96.
  3. Since programmers start counting from zero, the largest number that can be obtained is 95, which is 1011111 in binary.
  4. There are only 7 digits in this long number, and there are 8 of them in a byte, so there is one extra bit left from each number.
  5. 4 super tiles will give 4 bits.
  6. These 4 bits can be used to shift a row with a mirror image in a circle and get, as it were, a new row, without visible symmetry.

If you don’t know what the binary number system is, read our article about it, and then come back here.


4 super tiles give 4 bits. Let's see what we can do with them.


First they make a symmetrical level... And then they move the top strip to the right in a circle. 1100 is 12 in the decimal number system, this is exactly how many shifts to the right need to be made to get it like in the picture.


They do the same with the third line and get an acceptable beginning of the level.

By doing this, developers can change levels beyond recognition without wasting any extra memory at all. We remember that our screen is not the entire level; we need to draw the same number of times on top.

We use assembler

One of the programming methods for the set-top box is assembler.

Here's an example of how to show one sprite and animate it so that it moves and bounces off the edges of the screen.

ORG 2100h PPU_SPRITES: EQU $1004 SPRITE_CHR: EQU 72 SPRITE_COLORKEY: EQU $1F SPRITE_INIT_POS_X: EQU 140 SPRITE_INIT_POS_Y: EQU 124 jp main DS $2166-$ nmi: ; non-maskable interrupt (NMI) handler ld bc, PPU_SPRITES + 3 ld a, (sprite_dir) and a, 1 jr z, subX in a, (c) ; increase X inc a out (c), a cp 248 jr nz, updateY ld a, (sprite_dir) xor a, 1 ld (sprite_dir), a jp updateY subX: in a, (c) ; decrease X dec a out (c), a cp 32 jr nz, updateY ld a, (sprite_dir) xor a, 1 ld (sprite_dir), a updateY: inc bc ld a, (sprite_dir) and a, 2 jr z, subY in a, (c) ; increase Y inc a out (c), a cp 216 jr nz, moveEnd ld a, (sprite_dir) xor a, 2 ld (sprite_dir), a jp moveEnd subY: in a, (c) ; decrease Y dec a out (c), a cp 32 jr nz, moveEnd ld a, (sprite_dir) xor a, 2 ld (sprite_dir), a moveEnd: ret main: ld bc, PPU_SPRITES ld a, 1 out (c), a ; activate sprite 0 inc bc ld a, SPRITE_CHR out (c), a ; set the character to sprite 0 inc bc ld a, SPRITE_COLORKEY out (c), a ; set the color key for the sprite 0 inc bc ld a, SPRITE_INIT_POS_X out (c), a ; set the X coordinate of the sprite 0 inc bc ld a, SPRITE_INIT_POS_Y out (c), a ; set the Y coordinate of sprite 0 mainLoop: jp mainLoop sprite_dir: DB 0

Using the C language

We can also use the C language, for this we will need the SDCC compiler and some additional utilities.

The C code may turn out slower, but writing it is faster and easier.

Here is an example of code that does the same thing as the assembly code above, using a library that helps make calls to the PPU:

#include #define SPRITE_CHR 72 #define SPRITE_COLORKEY 0x1F #define SPRITE_INIT_POS_X 140 #define SPRITE_INIT_POS_Y 124 struct s_sprite sprite = { 1, SPRITE_CHR, SPRITE_COLORKEY, SPRITE_INIT_POS_X, SPRITE_INIT_POS_Y } ; uint8_t sprite_dir = 0; void nmi() { if (sprite_dir & 1) { sprite.x++; if (sprite.x == 248) { sprite_dir ^= 1; } } else { sprite.x—; if (sprite.x == 32) { sprite_dir ^= 1; } } if (sprite_dir & 2) { sprite.y++; if (sprite.y == 216) { sprite_dir ^= 2; } } else { sprite.y—; if (sprite.x == 32) { sprite_dir ^= 2; } } set_sprite(0, sprite); } void main() { while(1) { } }

Preparing the image

We will run our retro games on a specially developed Recalbox operating system based on Linux. But instead of the usual Linux, there is a well-prepared interface, tailored to the gaming component.

Well, a flash drive in your hands, an adequate laptop or PC based on it (it’s not necessary to create a distribution kit on an old one), let’s start preparing the drive.

1. Load the Recalbox image by selecting PC 32 bit (preferably) or PC 64 bit (depending on your PC). The distribution can be downloaded here [300 – 340 MB].

With the help of Etcher, in just a few minutes you can prepare the flash drive we need without delving into the nuances of creating bootable drives.

In Etcher, select the downloaded image -> Select the flash drive -> Click Flash. We are waiting for the copying to finish.

3. Now it’s time to download Recalbox on your old PC or laptop. Insert the USB flash drive, restart the computer and select the USB flash drive as the boot source.

— on Mac computers: hold down the Option key until the Apple logo appears and select a flash drive from the list;

- on Windows-compatible PCs or laptops: go to Bios and find the “First Boot Device” item in the list of settings. There should be a USB drive installed there.

How to get into Bios depends on the specific laptop model or motherboard. The most commonly used keys that should be pressed when booting are: Del (Delete), F10, F2. One of them will definitely suit you.

After a couple of minutes you will see the Recalbox logo and you can consider that most of the work is already done.

Be sure to connect a gamepad, since controlling Recalbox optimized for this type of manipulator from the keyboard is still a pain.

Dynamic graphics

(In the original Custom graphics. approx. per.)

The ROM of the console contains 1 page of tiles for the backing and another page of ready-made sprites), by default you can only use these fixed graphics, but you can switch to dynamic ones.

My goal was to have all the necessary graphics in binary form immediately loaded into the CHR RAM, and the code in the bootloader from ROM can do this. To do this, I made several pictures of the correct size with different useful symbols:

Since the dynamic graphics memory consists of 4 pages of 256 characters of 8x8 pixels each and 4 pages of the same characters for sprites, I converted the pictures to PNG format and deleted the same ones:

And then I used a homemade tool to convert it all into the RGB332 binary format with 8x8 blocks.

As a result, we have files with symbols, where all the symbols come sequentially one after another and each takes 64 bytes.

Adding a difficult mode to the game

When the player has completed all the levels, he can be given the opportunity to play on an increased difficulty: he already knows the whole game and can go through more difficult traps and bosses. For example, a hard mode may differ in level design and enemy behavior.

In order for this mode to fit into the remaining memory, tricks with memory and graphics are again used.


For the player to understand that difficulties have begun, they simply change the palette. This is almost the same from memory, but it looks more complicated.


The level can be changed like this: take the original picture, put new details on top and get a complex location. On average, this takes 7 bytes per screen.

Sound

Waveform RAW samples are converted to 8-bit 8KHz PCM samples.

Patches for PWM sound effects and music are written with special instructions.

As for the Yamaha YM3438 FM synthesis chip, I found a program called DefleMask that produces PAL-synced music and is intended for the YM2612 chip from Genesis, which is compatible with the YM3438.

DefleMask exports music in VGM format and I convert it with another home-made utility into my own binary format.

All binaries of all three audio types are combined into one binary file, which my bootloader can read and load into the SDN RAM audio memory.

Installing games

After we have configured and prepared everything, unpack the archive with games and upload it to your Smart TV or TV Box using a flash drive. Now open the main Kodi screen and select the “Games” section by clicking on it:

We need to select our games folder, so click “Add a game...”. In the window that opens, click browse, then find your games folder. When you open the folder, it will be empty, and that's okay. Click “OK”, then “OK” again. Done, upon completion you will be transferred back to the menu, which will contain your games folder.

Emulator

I wrote an emulator for my console in C++ using wxWidgets to make it easier to develop for it.

The CPU is emulated by the libz80 library.

Features for debugging have been added to the emulator, I can stop it at any time and do step-by-step debugging of the assembler, there is mapping to the source code in C if this language was used for the game.

From the graphics, I can look into the video memory, into the symbol tables and into the CHR memory itself.

Here is an example of a program running on an emulator with debugging tools enabled.

These videos were shot with a smartphone camera aimed at the CRT TV screen, I apologize for the imperfect picture quality.

BASIC interpreter programmable from a PS/2 keyboard, after the first program, I show how to write directly to the PPU memory through the I/O address space by activating and moving the sprite:

Graphics demo, in this video 64 16x16 sprites jump programmatically, against a background with dynamic scrolling and an overlay that moves under and above the sprites:

The sound demo shows the capabilities of the YM3438 and PWM sound, the sound data of this demo and FM music and PWM sounds together occupy almost all of the available 128 kilobytes of sound memory.

Tetris, for graphics almost only the background capabilities are used, music on the YM3438, sound effects on PWM patches.

This project is truly a dream come true, I have been working on it for several years now, intermittently, depending on my free time, I never thought that I would get so far in creating my own retro video game console. Naturally, it is not ideal, I’m certainly not an expert in electronics, there were clearly too many elements in the console and undoubtedly it could have been done better, and probably one of the readers is thinking about this.

But still, in the process of working on this project, I learned a lot about electronics, game consoles and computer design, assembly language and other interesting things, and most importantly, I got great satisfaction from playing games that I myself wrote on hardware that I myself developed and collected it.

I have plans to continue making consoles/computers. Actually, I’m already making a new set-top box, it’s almost ready, and it’s a simplified retro set-top box based on an FPGA board and several additional components, (in much smaller quantities than in this project, for sure), designed to be much cheaper and more repeatable.

Although I have written a lot here about this project, there is undoubtedly a lot more that can be discussed, I barely mentioned how the sound engine works, how the CPU interacts with it, and there is a lot more that can be said about the graphics system and other inputs and outputs and about the entire console as a whole. it would be nice to tell.

Looking at the reaction of readers, I may write more articles focusing on updates, details about individual units of the console or other projects.

1.3. Schematic diagram

This section provides detailed schematic diagrams of the processor module and remote controls, and also considers the option of constructing a cartridge with software for 8-bit DENDY game consoles.

1.3.1. Processor module

The DENDY game console usually has three boards: * central processor; * output connectors; * RF modulator and stabilizer. The boards are connected to each other by flexible flat (ribbon) cables. Sometimes there are options made on one or two printed circuit boards, but this does not affect the design of the set-top box. Initially, game consoles contained several chips of varying degrees of integration, with the main ones being the central processor and video processor chips. The development of microelectronics has led to the fact that game consoles now include only LSI type UM6561 or its equivalent. This chip houses the CPU, GPU, memory, and I/O registers on a single chip. Many Korean-made video consoles use several chips (usually two or three) instead of one UM6561. However, the operating principle of the set-top box and the signals at the output connectors do not change in this case, so these circuit options will not be considered here.

Multi-chip option

A schematic diagram of the first version of the DENDY game console, manufactured using several microcircuits of varying degrees of integration, is shown in Fig. 1.12. So, the basis of the game console is the central processor chip (IC1). The operation of the processor is synchronized by an external clock pulse generator made on transistors Q1 and Q2, the frequency of which is stabilized by quartz X1 (21.251465 MHz). The signals of all internal buses (addresses A0 - A15, data DO - D7 and control) of the game console are output to connector XS1, to which the cartridge is connected. Data buses (pins IC1/21-28), addresses (pins IC1/4-19) and control (pins IC1/31,34) connect the central processor (IC1) with the RAM chip (IC3) and the video processor (IC2). The address decoder on the 74LS139 chip (IC8) produces signals that allow other chips to communicate with the central processor. The decoder inputs receive the three most significant bits of the address bus A13 - A15 (pins IC8/2,3,13) and the M2 signal (pin IC8/14). If the processor operates with memory installed in a cartridge, then the V3 signal at pin IC8/9 is low. When data exchange occurs with the built-in RAM of the set-top box (IC3), the low level receives the AO signal at pin IC8/4. A low level signal at pin IC8/5 indicates that the central processor is using the video processor chip IC2. The sound processor of the game console and the I/O port address decoder circuit are also located on the same chip with the central processor.


The output signals of the first and second audio channels are mixed and sent to output AU1 (pin IC1/1), and the signals of the remaining channels are sent to output AU2 (pin IC1/2).
The complete audio signal is formed by mixing in a circuit made with resistors R8 - R12 and capacitor C7, and then fed to the output connector of the game console and to the input of the modulator that generates the RF signal. Three digits of the number (D0, D1 and D2) written to port 4016h are transmitted to the IC1/39-37 pins. Every time the processor reads from a port with address 4016h, a low-level pulse appears at the CK1 output (IC1/36 pin). And if the processor reads from the port with address 4017h, a similar pulse is generated at the output of CK2 (pin IC1/35). The output signals of the gaming consoles and the light gun are transmitted to the data bus through two buffer registers IC6 and IC7 (type 74HC368). The video processor chip IC2 together with the video memory chip IC4 produces full

video signal IC2 and IC4 are connected by address, data and control buses. The video memory chip IC4 is similar to the main RAM chip. Please note: in video processor IC2, the same pins (IC2/31-37) are used as both a data bus and an address bus. First, the low-order eight bits of the video memory cell address come here. When a low level signal appears at the ALE output (pin IC2/39), this data is stored in the buffer register IC5 (74LS373). Then the ALE output is set to a high voltage level, the high-order bits of the address remain at the IC2/26-30 pins, and the IC2/31-37 pins are used as a data bus. The video processor bus signals are also output to the XS1 cartridge connector. The complete video signal from the VIDEO OUT output of the video processor (pin IC2/21) is supplied through an emitter follower made on transistor Q3 to the VIDEO OUT output connector and to the modulator. Some models may not have a video signal amplification stage.

Now we will briefly talk about the main differences from the basic circuit present in other models. They all relate to the connectors used and the purpose of individual pins. There are two main design options for the gaming system in question. The NES console is equipped with a 72-pin connector for connecting a cartridge, a 48-pin expansion connector and 7-pin connectors for connecting game consoles. The FAMICOM (DENDY) game console is fully software compatible with the NES console, but uses a 60-pin cartridge connector, a 15-pin expansion connector and 9-pin connectors for connecting game consoles. The layout of all connectors of the DENDY game console is shown in Fig. 1.13a-c, and NES consoles - in Fig. 1.13g-e.

Single-chip option

A schematic diagram of a single-chip version of the DENDY game console is shown in Fig. 1.14. Here, the functions of the central processor, video processor and memory are performed by one LSI of the UM6561 type. The frequency of the internal clock generator is stabilized by the XI quartz resonator (26.601712 MHz). Sometimes the clock generator circuit also contains a transistor. Most output signals go directly to the XS4 cartridge connector. Some of the signals are sent to the connectors for connecting game consoles XS1, XS2 and the expansion connector XS3. Video and audio signals are transmitted to the output connectors of the game console and to the input of the modulator, sometimes through transistor amplifiers.

Output connectors

The DENDY console has two or three connectors for connecting remote controls, a light gun and other peripheral devices. Connectors can be of three types: 7-, 9- and 15-pin. Game consoles can be connected to the 7-1 or 9-pin connector for connecting the console or to the 15-pin console expansion connector, the light gun - only to the 7- or 15-pin connector, other devices - to the 15-pin connector. Two 9-pin connectors and one 15-pin expansion connector are used to connect remote controls. The DENDY console cartridge uses a 60-pin connector located on the top. The NES game console has two 7-pin connectors and one 48-pin expansion connector for game consoles. To connect a cartridge, the NES console uses a 72-pin connector, which differs from the 60-pin connector by the presence of additional circuits connected to the expansion connector. This connector carries signals from the video processor and central processor buses. The appearance of the connectors of the DENDY game console and the purpose of individual contacts are shown in Fig. 1.13. The expansion connector (Fig. 1.136) is discussed below, since it is the most

Convenient for connecting various additional devices. Pin 2 (AUDIO IN) provides an audio signal that is mixed with the output signals from the sound processor. Pins 4-8 (J2 DO - J2 D4) are the inputs of the corresponding bits of the second joystick port. The signal codes from these inputs can be obtained from port 4017h with the LDA $4017 command. The J1 D1 input (pin 13) is connected to the D1 bit of the 4016h port. When the central processor accesses ports with addresses 4016h and 4017h, short-term low-level pulses are generated at outputs CLK1 (pin 14) and CLK2 (pin 9). The DO -D2 bits of the word written to port 4 016h are transmitted to the OUT0 -OUT2 outputs (pins 10-12). The IRQ input (pin 3) receives an interrupt request signal.

1.3.2. Cartridge

The removable module of the DENDY game console - the cartridge - usually contains two ROM or RAM chips.
One ROM chip is connected to the video processor and stores character generator information. Instead of character generator ROM, some cartridges use a static RAM chip. Another ROM chip with software is connected to the central processor. Sometimes the cartridge board contains additional RAM powered by a lithium battery, which is designed to save the game situation. Almost all cartridges, with the exception of the simplest ones, have a memory page controller chip that performs the function of a programmable address decoder. Structurally, the DENDY console cartridge is a protective plastic case measuring 105x90x20 mm with a key in the form of two bevels for proper installation. It contains a printed circuit board with a 60-pin connector and installed unpackaged microcircuits: ROM, RAM and page controller. A schematic diagram of a game cartridge without additional RAM with an MVS1 type page controller is shown in Fig. 1.15. The cartridge consists of two ROM chips (IC1 and IC2) and a memory page controller IC3. Chip IC1 (27С128) is the ROM of the video processor! with character generators written in it. In the address space of the video processor, individual ROM pages are placed at addresses 0000h - 1FFFh. The low-order bits of the address are supplied to the IC1 chip directly from the corresponding pins of the XS1 connector. Senior digits Fig.
1.15. The schematic diagram of the DENDY game console cartridge with addresses VA12 and VA13 is formed by the memory page controller chip IC3. The selection of a ROM chip occurs when there is a low level signal at the CS input (pin IC1/20), connected to line VA13 of the video processor address bus. Data is transferred from the ROM outputs to the contacts of the XS1 connector. Chip IC2 (KONAMI ROM 1Mbit) is a mask ROM with a program recorded in it with a capacity of 1 Mbit (128 KB). The low-order bits of the address A0 - A13 come from the corresponding contacts of the cartridge, and the high-order bits of the address A14 - A16 are generated by the memory page controller IC3. The CS signal, which enables the operation of ROM IC2, is also transmitted from IC3. IC3 is a programmable address decoder that generates the most significant bits of the address for ROM chips IC1 and IC2. It also produces the VA10′ signal, the level of which determines the choice of screen display mode. In the cartridge under consideration, some of the outputs are not connected, so the capabilities of the microcircuit are not fully used.

1.3.3. Modulator

The DENDY game console modulator receives an image signal from the video processor chip IC2 and an audio signal from the central processor chip IC1 and generates a full RF television signal in one of the meter ranges. The modulator circuit is not standardized and is usually determined by the manufacturer. However, the operating principle and composition of the main components are always the same, so changes in the circuit should not cause difficulties during repairs. A schematic diagram of one of the possible options for the RF modulator is shown in Fig. 1.16. The RF master oscillator is made on high-frequency transistor Q2 (analogue of the KT368A transistor). It forms the carrier frequency of one of the television channels. Typically, the operating frequency of the set-top box generator is in the range of 170-230 MHz and is determined by elements L1, C8 - C11 1, R9 - R11. The frequency is adjusted by changing the inductance of coil L1. The generator, implemented on transistor Q1 (analogue of the KT3102 transistor), forms the audio subcarrier for the full television signal. The output signal of the generator is modulated by an audio frequency signal coming through circuit R4, C1 from the AUDIO IN input (pin 4 of CN1 connector). Depending on the country of manufacture of the set-top box, the generator frequency is 5.5 or 6.5 MHz. Fine adjustment of the signal frequency is carried out by rotating the core of transformer T1. The mixer, made on diodes D1, D2 (analogue of the KD503A diode), transformer T2 and transistor Q3, generates a complete RF television signal. The mixer input receives a master oscillator signal and a low-frequency video signal from pin 3 of the CN1 connector. From the output of the mixer, the RF signal is transmitted through the matching circuit C15, L3 to the RF OUT output connector of the processor module.

1.3.4. Game consoles

There are about ten different types of game consoles for the DENDY game console. However, the most widely used are the standard gaming remote control included in the package, a turbo remote control with additional buttons, and a light gun. Below are the schematic diagrams of these devices, as well as an adapter diagram for simultaneously connecting four remote controls.

Standard game controller

A standard gaming console for the DENDY console consists of a movable cross and four

separate buttons. An unframed shift register microcircuit, which is an analogue of the HEF4021B microcircuit, is installed inside the remote control. If the original chip is not available, almost any 8-bit shift register can be used. A schematic diagram of a standard remote control is shown in Fig. 1.17.

Rice.
1.17. Schematic diagram of a standard game console for the DENDY console. When a button is pressed during a game, a low level signal is sent to the corresponding input of the shift register. A high level when the buttons are open is ensured by connecting the register input lines to the +5 V power bus through resistors with a resistance of 10-68 kOhm. The states of the inputs in register IC1 are remembered when a high-level pulse arrives at the PE input of the microcircuit. After this, on the negative edge of the signal at the CLK input (pin IC1/10), the contents of the register are shifted and the most significant bit is issued on the D0 bus. The second gaming console supplied with the console may not have the START and SELECT buttons, but the circuit diagram of the console and its principle this does not affect work.

Turbo remote

The schematic diagram of the turbo remote control for the DENDY game console is shown in Fig. 1.18. The only difference between the turbo remote control and the standard one is the presence of an additional T6 Hz output on the shift register chip and two additional buttons TURBO A and TURBO B connected to this output. The internal generator of the remote control chip generates a sequence of pulses with a frequency of 6-10 Hz at the T output. Thus, pressing and holding the TURBO A button is the same as pressing and releasing the A button at an intensity of 6 times per second. The use of these buttons reduces wear and tear on the remote control keys, since buttons A and B are usually used in the game when shooting.


Rice.
1.18. Schematic diagram of a turbo remote control for the DENDY game console Adapter for connecting four remote controls

Some games allow up to four players. In this case, four game consoles are connected in parallel to the connectors of the game console via a special adapter. A schematic diagram of the adapter is shown in Fig. 1.19. As can be seen from the circuit diagram, the main task of the adapter is to ensure that information is read from consoles 1 and 3 during the arrival of the first eight sync pulses, and from consoles 2 and 4 during the next eight. The synchronization signal supplied via the STRB line fixes the state of the consoles in their internal registers and carries out the initial installation of the adapter circuits. During the first eight clock pulses, low logical level signals are generated at the Q8 outputs of counters IC1 and IC2, which ensures the arrival of clock pulses to consoles 1 and 3, as well as the transmission of information from these consoles to the inputs of the game console. After the eighth clock pulse sent from the game console when reading from the I/O port, a high logic level signal (log. 1) appears at the Q8 output of the corresponding microcircuit (IC1 or IC2), which leads to switching of the switch IC3 or IC4 and connection to the console connectors 2 or 4 remote controls respectively.

Light gun

In Fig. 1.20 shows possible options for the concept of a light gun for the DENDY game console. A phototransistor is used as a photosensitive element. In the cheapest set-top boxes it is sometimes replaced with a photodiode, which leads to a deterioration in the sensitivity of the device. The signal from the output of the photodiode through the isolation capacitor C1 is fed to an amplifier made on transistor Q1. From the collector of this transistor, the inverted signal through pin 5 along circuit D4 is transmitted to the processor module of the game console.

If the gun is pointed at the television screen, then a pulse signal is generated at output D4 with a frequency equal to the vertical scanning period. The trigger of the light gun is connected to a button with normally closed contacts. If the trigger is released, the contact of connector D3 is connected to the common wire. When the trigger is pressed, the contacts open, and a high logic level signal appears at input D3, which is provided by connecting this circuit inside the game console through a 10-51 kOhm resistor to the +5 V bus.

1.3.5. power unit

The power supply for the DENDY game console consists of an external network adapter and an internal stabilizer.

The task of the external network adapter is to convert the mains voltage ~220 V into a constant voltage of 9-12 V, which is transmitted to the internal stabilizer of the game console. The schematic diagram of the DENDY network adapter is shown in Fig. 1.21. When repairing the unit, remember that on the output connector the central contact is connected to the common wire.

The unstabilized voltage from the adapter is supplied to the internal stabilizer of the game console, made on an AN7805 chip or on a transistor and located in the processor module. A constant voltage of +5 V is generated at the output of the stabilizer. Schematic diagrams of two options for the supply voltage stabilizer for the DENDY game console are shown in Fig. 1.22 and do not need additional description.

Rice.
1.22. Schematic diagrams of the supply voltage stabilizer for the DENDY 1.4 game console.
Typical faults The set-top box does not turn on
Possible reasons: faulty network adapter or internal stabilizer; short circuit or break in power supply circuits; cartridge malfunction; processor module malfunction. Troubleshooting algorithm: 1. Measure the output voltage of the network adapter. If it exceeds 9-12 V, replace the AC adapter. Practice shows that most often failures are caused by rectifier bridge diodes. If the transformer fails, any power source with an output voltage of 9-12 V and a permissible load current of 500 mA will do. 2. Disconnect the remote control, cartridge and modulator from the processor module, and then check the game console units for short circuits. If a short circuit is detected, after eliminating it, check the stabilizer and the low-resistance resistor installed in it. When an overload occurs, one of the printed conductors in the power circuit usually breaks, so it is necessary to carefully inspect the boards and ensure the integrity of the conductors. 3. If there is no short circuit, check the internal stabilizer of the game console. The voltage at the stabilizer output should be within 5±0.1 V; otherwise, in a stabilizer made on the AN7805 chip, you should replace the IC1 chip (analogous to KR142E-N5A) and check the capacitors C1 - C4. In a stabilizer implemented on a transistor, check transistor Q1 (possible replacement - KT815), zener diode D1 (possible replacement - KS156A) and resistor R1. Instead of a resistor, it is permissible to install a fuse that will protect the stabilizer from short circuits. 4. Turn on the set-top box without remote controls, modulator and cartridge. The VIDEO OUT jack must have a video signal. When this signal is applied to the low-frequency input of the TV, a chaotic image consisting of colored dots and squares will appear on the screen. The presence of an output signal indicates a malfunction in the remote control or modulator. 5. If there is no output signal, check the crystal oscillator and transistor video signal amplification stage. The serviceability of the quartz resonator X1 and transistors Q1 - Q3 allows us to conclude that it is necessary to replace the entire processor module.

The device is unstable

Possible reasons: malfunction of the external network adapter or internal stabilizer;
contacts of the cartridge connector are dirty. Troubleshooting algorithm:
1. Check the output voltage of the network adapter. Often a failure occurs due to the low load capacity of the adapter supplied with the game console. The problem is solved by connecting a more powerful adapter. 2. Check the reliability of the contact connections in the connectors of the set-top box. The cartridge connector must be inspected especially carefully. Clean contacts with alcohol. 3. Check the internal stabilizer of the game console. It is useful to install a stabilizer chip or power transistor on a radiator with a sufficient dissipation area (about 10 cm2). 4.Install additional capacitors in the power supply circuit, for example, with a nominal value of 100.0 µF x 16 V and 0.01 µF on each of the set-top boards and in the cartridge.

Light gun doesn't work

Possible reasons: a break in the connecting cable or bad contacts in the connector;
malfunction of the photodiode or transistor of the light gun; faulty trigger contacts in the light gun. Troubleshooting algorithm:
1. Check the integrity of the connecting cable and the reliability of the connection in the connector. If the connector fails, replace it together with the mating part with any available 7-pin connector. 2. Check the transistor in the light gun and the contacts under the trigger. Make sure that the contacts are closed when the trigger is pressed, since failure, as a rule, occurs in the mechanical part of the gun. 3. The low sensitivity of the pistol is often explained by the displacement of the focusing lens installed in the barrel. In this case, it is necessary to install the lens in place and secure it. Adjusting the lens mounting location can improve the performance of even a working light gun. 4. The serviceability of the internal circuits of the light gun indicates the need to replace the entire processor module of the game console.

The remote control doesn't work

Possible reasons: break in the connecting cable or poor contact in the connector;
dirty buttons; The remote control chip is faulty. Troubleshooting algorithm:
1. Check the integrity of the connecting cable and the reliability of the connection in the connector.
If the connector fails, replace it together with the mating part with any available 7-pin connector. 2. Check the PE and STROBE input signals. The absence of signals indicates the need to replace the central processor. 3. Check the output signal of the microcircuit installed in the remote control. If there is no signal, replace the remote control. Some buttons on the remote control do not work.
Possible reasons: the remote control is dirty or the microcircuit is faulty. Troubleshooting algorithm: 1. Wipe the remote control board and the rubber gasket with conductive pads with alcohol. 2. If the conductive pads on the rubber gasket are faulty, restore them by gluing pieces of foil. It is more convenient to use foil from cigarette packs: it has a paper base, which provides better adhesion to rubber. 3. If the conductive coating on the board is damaged, restore it using a cleaned mounting wire soldered to the tracks of the printed circuit board. 4. If all contact pads are in good condition, it is necessary to replace the microcircuit installed in the remote control, or the entire remote control.

No RF signal at the modulator output

Possible reasons: violation of the generator settings, malfunction of the master generator or mixer. Troubleshooting algorithm: 1. Make sure that the faulty element is in the RF modulator circuit by checking the presence of video audio signals at the LF output. The absence of any of these signals indicates a breakdown of the processor module. 2. If there is no sound or image, the master oscillator is most likely malfunctioning. To check the generator, you should measure the frequency of the output signal: it should be in the range of 170-230 MHz. The absence of a signal allows us to conclude that it is necessary to replace transistor Q2. If the generator frequency goes beyond the specified limits, it is necessary to check elements LI, C8 - C11, R10, R11. 3. After making sure that the master oscillator is in good condition, check the mixer (diodes D1, D2 and transformer T2), as well as the matching circuit L2. C13, C14. 4. The absence of an audio signal during a normal image indicates a failure of the audio frequency sub-carrier generator. In this case, check that the frequency of the IF sound generator corresponds to the television standard (5.5 or 6.5 MHz) and, if necessary, adjust the generator by rotating the core of transformer T1. If there is no signal at the generator output, replace transistor Q1.

Where to get games and how to install them

The games shown in the screenshot were installed independently

By default, Recalbox comes with a few old-school toys included. Among the presented consoles: Super Nintendo, Sega, Gameboy Advanced and the classic shooter game Doom.

I’ll say right away that the preinstalled set of games will disappoint you, to put it mildly. Therefore, we need to download what we played at the dawn of consoles.

Fortunately, the network has almost the entire collection, which in the early 90s would have taken up a couple of rooms littered with glitchy and hated cartridges.

You cannot install games in Recalbox by simply copying them to a flash drive. Don't even try. To do this, you need to connect your PC or laptop to the network.

You can download games from the following sites:

    – a Russian-language site where dozens of consoles are presented; ; ; ;

In fact, there are hundreds of sites and if you want you can find anything you want. Google to the rescue.

Each game is presented in a ZIP archive. We need it to upload to Recalbox. As I wrote above, you won’t be able to copy the game to a flash drive. We need to connect our PC or laptop to the network.

Ideally, use the built-in Ethernet port, since it does not require additional configuration. We inserted a twisted pair cable into our makeshift console and we were done.

Do you want Wi-Fi? Then open the settings in Recalbox (Start button on the gamepad) -> Network settings -> Enable WiFi -> set network settings and password.

When the connection is successfully established, you will see the IP address issued to our “console”. You remember it and enter it into the address of your main laptop (not the ancient one). In my case it is 192.168.0.1

Tip: To download large games, use an FTP manager. The games that can be downloaded from the Recalbox web interface are limited in size.

After the download is complete, you need to restart Recalbox on your laptop. The installed game will immediately appear in the list.

Feel free to click Start and enjoy the gameplay from 10 to 30 years ago. Good game!

Recalbox is an excellent option that gives you the opportunity to feel nostalgic for the past and remember what the good old Super Mario, Battle Tanks, Crash, Super Bomberman and other masterpieces were like.

(9 votes, overall rating: 4.44 out of 5) Bookmarks

In my opinion, the whole point of assembling a console is in 3 stages.

Rating
( 1 rating, average 5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]