diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-18 16:05:14 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-18 16:05:14 +0100 |
| commit | 8f2acc62a46a0233151faadad1a7d2a828bef3a4 (patch) | |
| tree | 1e7c3a038cbb7b2dad4ded77c7d2c40f4aaa4d3f /src/items.s | |
| parent | 6b72b7d120720086709df2c4aa9f4ab50b6fad8f (diff) | |
| download | jetpac.nes-8f2acc62a46a0233151faadad1a7d2a828bef3a4.tar.gz jetpac.nes-8f2acc62a46a0233151faadad1a7d2a828bef3a4.zip | |
Fix the high byte for the timer initialization
In my infinite wisdom, in order to compute the high byte of the 16-bit
timer I masked away the most significant byte, but then shifted right
only for a nibble instead of a full byte. This went mostly unnoticed as
the value I'm setting for the timer actually falls below of what a byte
can represent and, thus, the high byte was always zero. But this was
noticeable when I was testing larger numbers which, unsurprisingly,
turned out to be _huge_.
Fix this by shifting right a full byte instead of a mere nibble.
Fixes: cf3a0c963225 ("Implement falling items")
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src/items.s')
| -rw-r--r-- | src/items.s | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/items.s b/src/items.s index 4d87b00..885ce7b 100644 --- a/src/items.s +++ b/src/items.s @@ -99,7 +99,7 @@ ;; Constants for 'Items::zp_timer'. ITEM_TIMER = HZ * 4 ITEM_TIMER_LO = ITEM_TIMER & $00FF - ITEM_TIMER_HI = (ITEM_TIMER & $FF00) >> 4 + ITEM_TIMER_HI = (ITEM_TIMER & $FF00) >> 8 ;; Timer that determines when to drop a new item from the sky. It is ;; initialized on screen entry or after time out. |
