<feed xmlns='http://www.w3.org/2005/Atom'>
<title>jetpac.nes/bin/rand.rb, branch main</title>
<subtitle>Port to the NES/Famicom of "Jetpac" from Ashby Computers and Graphics Limited.
</subtitle>
<id>https://git.mssola.com/nes/jetpac.nes/atom?h=main</id>
<link rel='self' href='https://git.mssola.com/nes/jetpac.nes/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/jetpac.nes/'/>
<updated>2026-03-05T17:49:02Z</updated>
<entry>
<title>Make randomness a bit more random</title>
<updated>2026-03-05T17:49:02Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mssola@mssola.com</email>
</author>
<published>2026-03-05T17:49:02Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/jetpac.nes/commit/?id=0de830d9ac786fbbf32e9abebf3975e909b1a5e7'/>
<id>urn:sha1:0de830d9ac786fbbf32e9abebf3975e909b1a5e7</id>
<content type='text'>
Signed-off-by: Miquel Sabaté Solà &lt;mssola@mssola.com&gt;
</content>
</entry>
<entry>
<title>Update values on the RNG table</title>
<updated>2026-02-13T21:36:21Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mssola@mssola.com</email>
</author>
<published>2026-02-13T21:36:21Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/jetpac.nes/commit/?id=d1e9cb8939c2020cfd5416d68b4bd4de90f14d6d'/>
<id>urn:sha1:d1e9cb8939c2020cfd5416d68b4bd4de90f14d6d</id>
<content type='text'>
This way enemies are a bit more off from the boundaries, avoiding
visually distracting scenarios.

Signed-off-by: Miquel Sabaté Solà &lt;mssola@mssola.com&gt;
</content>
</entry>
<entry>
<title>bin: improve the style and add more documentation</title>
<updated>2026-02-11T21:15:43Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mssola@mssola.com</email>
</author>
<published>2026-02-11T21:15:43Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/jetpac.nes/commit/?id=731bc2e0855de04ec7f57d63e09105fa7f619a45'/>
<id>urn:sha1:731bc2e0855de04ec7f57d63e09105fa7f619a45</id>
<content type='text'>
And also run rubocop on the CI for good measure.

Signed-off-by: Miquel Sabaté Solà &lt;mssola@mssola.com&gt;
</content>
</entry>
<entry>
<title>Simplify the random_valid_y_coordinate function</title>
<updated>2026-02-10T21:45:20Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mssola@mssola.com</email>
</author>
<published>2026-02-10T21:45:20Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/jetpac.nes/commit/?id=1b46ddb0486276de0b0691e10277d206a0763300'/>
<id>urn:sha1:1b46ddb0486276de0b0691e10277d206a0763300</id>
<content type='text'>
This function relies on a pre-computed table to get the "random" numbers
from, but most of the times this is used, it needs to be between some
safe boundaries.

Before this commit, this was done inside of the function, correcting the
fetched value to be above or below these limits. But there was a bug on
the below the grounds limit, in which the 'sbc' instruction could
subtract too much from the fetched value and make enemies appear below
the sky.

Now, this is easy to correct, but since we are cheating with a
pre-computed table, I thought it would be vastly easier to just get a
random table with the "proper" values. That is, random but within the
required boundaries already. Plus, it makes the
'random_valid_y_coordinate' function much faster.

This commit adds a ruby script in bin/ which produces a pseudo-random
table when called, making sure all the requirements are met. We have to
make sure to call this script if we ever change the boundaries at some
point.

Signed-off-by: Miquel Sabaté Solà &lt;mssola@mssola.com&gt;
</content>
</entry>
</feed>
