(español abajo)
I have finished analyzing 1943 schematics and I have started writting the new core. This game looks much more advanced than 1942 but if you were to check only the CPUs it is the same: two Z80 CPUs. However, there are things they have done to the GPU (which is made of discrete parts, rather than a large chip) to free up the CPU even more.
First, they seem to reuse the DMA scheme for sprites that Ghosts'n Goblins had. I cannot guarantee it is 100% identical because they have it on a custom chip but judging by signal names and external elements it will be very similar if not identical. That means that the same Z80 CPU can now handle more sprites on screen.
On the old 1942 the CPU spent a lot of time drawing the background map on a shared memory. The GPU reads that map and the tile ROMs in order to draw the background on screen. The sequel 1943 has two scroll planes, which means two backgrounds. Still, it uses the same Z80 with more action on screen than before. How? Well, by the time 1943 was released the manufacturing price of ROM had more than halved with respect to the 1942 time so the designers went for full sized map ROMs. The CPU only has to select the active region of the ROM (shown in the image as the PIC lines) and data for the background is extracted from it automatically. The GPU uses this data in the same old way: to look into the tile ROMs to draw the background. The difference is that the CPU just writes an 8 bit value to select which screen will be displayed, rather than copying the whole screen to a shared memory (2048 bytes is the size of a screen). So this design frees the CPU from doing large memory transfers to draw the screen.
Compare this to a clasic 8-bit computer, like an Amstrad CPC. The CPC would need to transfer 0.5*160*200=16,000 bytes to draw a background screen. The 1943 CPU gets the same result transferring 1 byte, and it draws a 256x224 screen with more colours. You can see the huge advantage that arcade machines had over home systems.
Español
He terminado de analizar los diagramas del 1943 y ya estoy escribiendo el nuevo core. Una de las cosas que me llamaban la atención de este juego es que usa las mismas CPUs que el anterior 1942 pero el juego se ve mucho más avanzado. ¿Cómo es esto posible?
Bueno, para empezar usan el esquema de DMA para la memoria de objetos que ya expliqué con el Ghosts'n Goblins. No puedo estar seguro de que sea 100% igual al de GnG porque aquí lo han metido en un chip propio. Pero a juzgar por el nombre de las señales y por las partes que son externas al chip, sino es exactamente igual, es muy parecido. Esto ahorra mucho tiempo a la CPU y permite manejar más sprites.
Para los fondos, 1942 y GnG escriben dos bytes por cada cuadrado de 8x8 píxels del fondo. Estos datos van a una memoria compartida por la GPU (porque aunque hecha con componentes discretos, podemos llamarla GPU). La GPU lee esos dos bytes y los usa como índice para leer las ROMs donde están las teselas que componen el fondo. La CPU gasta mucho tiempo copiando estos 2 bytes por tesela de 8x8 a la memoria intermedia. Sin embargo, 1943 tiene dos fondos y no sólo uno... ¿cómo es posible?
Pues bien, el precio de la memoria ROM para cuando se hizo 1943 era menos de la mitad de cuando se hizo 1942 así que podían permitirse usar más de esta memoria. Los mapas de 1943 están completamente descomprimidos en unas memorias ROM que la CPU indexa (las señales PIC de la imagen). Así que para elegir que pantalla se pinta la CPU sólo tiene que escribir un byte, un único byte, frente a los 2048 que tenía que escribir la misma CPU en 1942. La ventaja es evidente.
¿Y si lo comparamos con un ordenador doméstico de la época? Un Amstrad CPC pintaba una pantalla de 160x200 píxeles y cuatro colores por píxel escribiendo 16.000 bytes. La máquina 1943 pinta 256x224 píxels a 64 colores por píxel escribiendo un byte. Ya os podéis imaginar que aunque sea el mismo Z80, este está mucho más libre para en la máquina que en el ordenador. Y para añadir humillación a la derrota, 1943 usa un Z80 más rápido que el del Amstrad, funcionando a 6MHz en vez de los 4MHz del Amstrad. No hay color.
Ruben
2019-02-23 02:41:55 +0000 UTCScralings
2019-02-21 14:45:53 +0000 UTC