XaiJu
JOTEGO
JOTEGO

patreon


Popeye Graphics Explained (1)

(español abajo)

Popeye is a great example of single-screen games. Nowadays we are used to exploring giant worlds but Popeye reminds us that a good game design needs no more than one screen. But how was that screen rendered?

The engineers behind this awesome hit combined three different graphics systems. Let's see them!

First, there is a character layer. Using a small ROM memory where each bit represented either transparency or opaqueness, the artists drew all characters seen in the game and also some figures. But the drawings didn't have any colour information. The memory was addressed directly by the vertical line counters for the lowest three bits. As the image progressed through the screen the line counters advance automatically and this moves data out of the ROM at the right pace. Each byte contained exactly 8 pixels. The game then writes a 4-bit code for the colour of each 8x8 block in a separate small RAM that is read at the same time as the ROM. Combined, these two memories produced the colour characters we see on screen. Note that no letter will be shown with two different colours. Although the hardware can be hacked by software to produce that. MAME wouldn't support such a hack though!

The background uses a very unusual technique on arcades: a bitmap! There are two 4-bit memories that the game CPU can access. Because the CPU is an 8-bit system, addressing the 4-bit RAMs requires extra glue logic but the engineers developed a smart arrangement to make this possible. Nice! Each pixel on screen is assigned a 4-bit position in the RAM plus a 5th bit which is shared for a larger number of pixels. How many and how is determined by the software and the hardware is extremely flexible there. Indeed, there are so many ways in which programmers could tweak the video hardware in Popeye that current emulation of it would need fixing if any homebrew developer puts his hands on this game board (or FPGA!).

I leave the explanation of the sprites for the next post ;-)

Español

Popeye es un juego brillante de una sola pantalla. Ahora tenemos grandes entornos tridimensionales que explorar pero Popeye es un gran ejemplo de cómo un buen diseño no necesita más que una pantalla. Pero, ¿cómo se pintaba esa pantalla?

Primero hay una capa de caracteres. Esta capa se basa en una memoria ROM en la que cada byte contiene justo 8 píxeles. Sólo información de transparencia u opacidad. El color no está almacenado en la ROM. La ROM se lee automáticamente con las tres líneas de dirección más bajas controladas directamente por los contadores de línea de la placa. Así, conforme la imagen avanza en pantalla la ROM se lee progresivamente. En una memoria RAM pequeña la CPU escribe cuatro bits por cada bloque de 8x8 puntos que se pinta. Estos 4 bits son el índice de la paleta de colores. Los caracteres no pueden mezclar colores en principio, todo el carácter tiene un único color. Aunque realmente, el software podría modificar un carácter al vuelo y mezclar colores dado el hardware real (o la FPGA). ¡Esto no lo soportaría MAME!

Luego está el fondo. Sorprendentemente, ¡el fondo es un mapa de bits! Esto no es una técnica habitual en arcades. El procesador pinta directamente el fondo usando dos memorias RAM de 4 bits. Pero la CPU es de 8 bits así que no puede conectarse tal cual a memorias de este tamaño. Los ingenieros de Nintendo añadieron unos circuitos para poder controlar estas memorias cómodamente desde la CPU, ¡bien hecho! Los fondos son más ricos de color, con un índice de paleta de cuatro bits por píxel (16 colores) y además un quinto bit se asignaba para un grupo de píxeles mayor del fondo (añadiendo otros 16 colores). ¿Para cuantos píxeles del fondo? Pues la CPU podía controlar eso por software. De hecho, se pueden controlar muchos detalles de los gráficos por parte de la CPU de una forma tan íntima que si cualquier desarrollador de homebrew le da por trabajar en esta placa (o en la versión FPGA) ¡forzaría una revisión de MAME!

Explicaré el funcionamiento de los personajes en la siguiente entrada ;-)

Popeye Graphics Explained (1)

Comments

This is super interesting to me at the moment, thanks for sharing. I just finished reading this blog post about the Bomb Jack rendering hardware: https://floooh.github.io/2018/10/06/bombjack.html I'm very keen to try to get a better grasp of this stuff. I've currently got the Rygar schematics which I am trying to analyse, and maybe one day turn into a core. Still a lot of stuff to learn.

nullobject

Thanks for introducing this magic game to me!

JOTEGO

Awesome write up man. Thank you so much for all your hours of hard work and tenacity!!!

Scralings


More Creators