pouët.net

Go to bottom

hireslife by SinDiKat [web]

HI-RES Convay's Game of Life

Author:      Michal "Loki" Lokša [SinDiKat]
System:      C64
Language:    Assembler
Compiled by: KickAssembler 1.3.5
Packed by:   LZX Packer 02 By Busy
Depacker based on Z80 LZX depacker

Description:
This is tech demo of fastest stream data processing of Conway's Game of life.
It is first implementation in maximum resolution for Commodore 64 - 320x200 pixels.
Extra information is draw in sprites at bottom border. Like number of generation, progress bar and live cells counter.
It costs extra CPU time to collect information and draw to sprites at border, but it is nice byte filler.
Still 27 bytes left!
Main idea is to process two cells at the same time with reading its neighbour's data as little as possible.
In classic character cell drawing is one cell stored in one byte. It is needed to read at least 9 bytes to calculate
new value of cell. In pixel format it is much cheaper. From 8 bytes surrounding current processed byte
we can calculate 8 pixels. Therefore smart using of readings, caching and precalculated life values is really needed
to squize algorithm to the fastest on the world.

Run by "Forever Party version\hireslife.prg"

Some calculations:
Procesor speed: 985248 Ticks/s
Resolution: 320x200 (WxH)
Native frames per seconds: 50.125

One generation is calculated in 150 frames.

985248/50.125*150/(320*200) = 46.07 Ticks/Cell (bad lines included)
320*200/150*50.125 = 21386 Cells/s


Turning on ultra fast mode where are disabled sprites and counting of live cells:
One generation is calculated in 137 frames.

Run by "Experimental builds\Ultrafast\hireslife-uf.prg"

985248/50.125*137/64000 = 42.08 Ticks/Cell (bad lines included)
64000/137*50.125 = 23416 Cells/s


Comparison against other implementations from the world:
https://tomtoad.itch.io/conways-game-of-life-c64-version
62 frames, resolution 80x50, 304 Ticks/s, 3233 Cells/s

https://csdb.dk/release/?id=121741
22 frames, resolution 40x25, 432 Ticks/s, 2278 Cells/s
Go to top