From 8f2acc62a46a0233151faadad1a7d2a828bef3a4 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 18 Mar 2026 16:05:14 +0100 Subject: Fix the high byte for the timer initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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à --- src/items.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. -- cgit v1.2.3