From 3c6a583190b827c0e88e535d486a4f191ee255c0 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 2 Apr 2024 23:49:52 +0200 Subject: Add a way to safely read from controllers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First of all, move some reading utilities into the new `shared` directory, so controllers can be read by more than one example. Second, even if we keep the example on `basics/input.s` simple, let's provide a safe alternative for the other examples. Signed-off-by: Miquel Sabaté Solà --- basics/input.s | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'basics/input.s') diff --git a/basics/input.s b/basics/input.s index dbb9ee6..6918487 100644 --- a/basics/input.s +++ b/basics/input.s @@ -8,6 +8,11 @@ ;; we are constantly polling it and filling it, the value will move constantly). ;; - $21: the previous status of the right arrow. ;; - $42: the counter which is incremented on each press of the right arrow button. +;; +;; Whenever you are done with this example, hop into the `shared/joypad.s` file, +;; which brings some other considerations when reading from controllers. That +;; is, the algorithm shown below is not entirely "safe" due to a hardware bug +;; which might give unreliable inputs on some spikes. ;;; ;;; -- cgit v1.2.3