aboutsummaryrefslogtreecommitdiff
path: root/.nasm
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-28 00:27:09 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-28 00:27:09 +0100
commita2411d86a504adbc027a93c8bddb1ba0e0f447fd (patch)
tree8d350c260010d36698bd678dbc75cde4111bbfdd /.nasm
parent3fc9105696e4fb1388abf4036fc7bc693fa950c7 (diff)
downloadjetpac.nes-a2411d86a504adbc027a93c8bddb1ba0e0f447fd.tar.gz
jetpac.nes-a2411d86a504adbc027a93c8bddb1ba0e0f447fd.zip
Fix overwrite issues when adding scores
The add_to_player() function relied on parameters to be passed on the 'Globals::zp_tmpX' variables, but that's just plain stupid. First, because these memory addresses are not meant for arguments; but most importantly, because callers actually needed some of these values before calling this function. Hence, everything went into chaos and sprites began to act wrongly in all sorts of random ways. Moreover, some of the callers also needed a guarantee on either the 'x' or the 'y' registers. Since this wasn't always feasible, we needed to store/load these registers' values case by case. All in all, now add_to_player() accepts only one argument via the 'y' register (which callers already knew it was going to be messed with). The value on 'y' has to be set via some helper constants. As a cherry on top, this not only fixes a nasty bug, but it also makes things more performant and with less code. Fixes: 63ef73de3bdd ("Update scores on screen") Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to '.nasm')
-rw-r--r--.nasm/segments.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/.nasm/segments.txt b/.nasm/segments.txt
index 4b41793..138a744 100644
--- a/.nasm/segments.txt
+++ b/.nasm/segments.txt
@@ -1,4 +1,4 @@
- HEADER: 16/16 (100%)
-- ROM0: 9112/32762 (27.81%)
+- ROM0: 9106/32762 (27.79%)
- ROMV: 6/6 (100%)
- ROM2: 8192/8192 (100%)