From 88728b89fed87326dae23619e2e93d4bd060a3ea Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 1 Apr 2025 21:19:45 +0200 Subject: Adapt velocity constants for PAL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In 2f140cfb7ea7 ("player: First PAL implementation") the rate of acceleration was adapted for PAL. Now the values for velocities have been adapted as well, in a way that we get (virtually) the same experience in PAL and in NTSC. This has been done by moving the velocity constants into configurable values, which are then picked up by a new bin/values.rb script. This script allows us to write the constants in plain floating point numbers, does the conversion to fixed point numbers as expected, and it also does the same for PAL by applying the proper NTSC to PAL conversion. As a cherry on top, some values have also been tuned to match the original game more closely, even if some more fine tuning might still be needed here and there. Signed-off-by: Miquel Sabaté Solà --- Makefile | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 74a3d93..a00dc6b 100644 --- a/Makefile +++ b/Makefile @@ -7,12 +7,23 @@ else Q = endif +# NOTE: you can configure `CC65` and `CCOPTS` with the compiler and its options +# that you might require. Moreover, if you pass `DEBUG` to `make`, then an +# `out/labels.txt` file will be generated. CC65 ?= cl65 CCOPTS ?= --target nes ifeq "$(DEBUG)" "1" CCOPTS += -g -Ln out/labels.txt endif +# Ruby is used to generate the files on `config/values/`. If it can't be found, +# a warning will be echo'ed. +# +# NOTE: you can actually set RUBY as an argument to `make` if you want to pass +# something special to it. +RUBY ?= ruby +HAS_RUBY := $(shell command -v $(RUBY) >/dev/null 2>&1 && echo true || echo false) + .PHONY: all all: clean deps build @@ -25,10 +36,19 @@ clean: .PHONY: deps deps: - @which $(CC65) >/dev/null 2>/dev/null || (echo "ERROR: $(CC65) not found." && false) + @which $(CC65) >/dev/null 2>/dev/null || (echo "ERROR: '$(CC65)' not found." && false) + +.PHONY: gen-values +gen-values: +ifeq ($(HAS_RUBY),true) + $(E) " GEN config/values" + $(Q) ruby bin/values.rb +else + @(Q) echo "WARNING: '$(RUBY)' not found; files under 'config/values/' will not be generated." +endif .PHONY: build -build: build-full build-partial build-pal +build: gen-values build-full build-partial build-pal .PHONY: build-full build-full: -- cgit v1.2.3