pouët.net

Go to bottom
TinyLife-6502
screenshot added by orac81 on 2025-11-13 15:42:22
platform :
type :
release date : november 2025
  • 2
  • 0
  • 0
popularity : 53%
 53%
  • 1.00
alltime top: #43487
added on the 2025-11-13 15:42:20 by orac81 orac81

popularity helper

increase the popularity of this prod by spreading this URL:

or via: facebook twitter pinterest tumblr bluesky threads

comments

TINYLIFE


This is a "size-code" version of the classic LIFE game, for the Commodore C64, C16, VIC20, PET. The smallest version is 126 bytes (see smallbin folder), but I recommend using the slightly bigger version with built in edit and help.

To use, just edit using the PET editor to create the patterns using the
letter "O" for the cells.
Note that the program is very simple, ie. it doesnt handle screen
wrap properly. But it is quite fast.

The "small" version needs the user to edit before running. Put the "run"
command on the 2nd line. This version needs VIC20 users to type:
POKE 36879,8:print chr$(5)chr$(147) before editing.

To avoid all that, use the "big" version!

Realeased as FREE/GPL3 software, source included.

https://github.com/orac81/miniapples/tree/main/lifet
added on the 2025-11-13 15:45:07 by orac81 orac81
A few more code notes..

This version will go down by 12 bytes to 114 bytes if you loose the BASIC stub and start with a SYS. But it does rely on the PET editor to setup the start pattern, some machines dont have that. As a simple hack you could just fill the screen with random data to start.
The code depends on having a pet style mem mapped char screen. So it might be portable to uk101 or BBC text mode or Apple2 text (with address translation) but other bitmap screen 6502 systems (oric?) would need additional code. Most sizecode stuff is very system dependant.

The code makes a complete copy of the screen with just bit 0 kept, so each byte is 0 or 1. Letter O or petscii "ball" (81) have bit 0 set. It then uses this code to count the surrounding cells:

Code: CLC ; Add 8 surrounding cell values together LDA (ZWORK),Y INY ADC (ZWORK),Y INY ADC (ZWORK),Y LDY #VDUX ADC (ZWORK),Y INY INY ADC (ZWORK),Y LDY #VDUX+VDUX ADC (ZWORK),Y INY ADC (ZWORK),Y INY ADC (ZWORK),Y ; A=Surrounding cell count


Now, instead of copying the screen, if you kept a 3 line rolling wrap around 256 byte buffer (with just bit 0 copied) you can just use 8 ADC ABS,Y instructions, with the ABS offset set for each cell , which will eliminate the INY and be faster. Remember that you read 8 cells for every new cell, so you want to make the count as fast as possible.
You could implement proper wrap around at the same time. That would make the code bigger than 126 bytes though.

A version using Petscii quarter pixel gfx would give 80x50, with the right code using that method should be quite fast. It would need a special editor for it.
rulez added on the 2025-11-18 13:43:07 by orac81 orac81
Neat :)
rulez added on the 2025-11-19 12:44:26 by mermaid mermaid

submit changes

if this prod is a fake, some info is false or the download link is broken,

do not post about it in the comments, it will get lost.

instead, click here !

[previous edits]

add a comment

Go to top