From 226e2ac1e29ab67c0408c0858ab40a696b132bc2 Mon Sep 17 00:00:00 2001 From: raul garcia Date: Sat, 28 Sep 2024 22:46:50 +0200 Subject: [PATCH 1/2] example is any key pressed --- cpctelera/src/keyboard/cpct_isAnyKeyPressed.s | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cpctelera/src/keyboard/cpct_isAnyKeyPressed.s b/cpctelera/src/keyboard/cpct_isAnyKeyPressed.s index ec2f670b1..51389f652 100644 --- a/cpctelera/src/keyboard/cpct_isAnyKeyPressed.s +++ b/cpctelera/src/keyboard/cpct_isAnyKeyPressed.s @@ -49,6 +49,16 @@ ;; be updated* with current key status. To do this, ;; routines *must be* used before calling this function. ;; +;; Next code example shows how to use this function in conjunction with . +;; +;; (start code) +;; any_key_pressed() { +;; u8 key_pressed; // Declares symbol +;; cpct_scanKeyboard(); // Updates the keyboard status +;; key_pressed = cpct_isAnyKeyPressed(); // Checks if any key is pressed, and +;; // returns a number not 0 if a key is pressed. +;; } +;; (end code) ;; Destroyed Register values: ;; A, B, HL ;; From 85d0009d033e2ce34922f40666ffb1785747e143 Mon Sep 17 00:00:00 2001 From: raul garcia Date: Mon, 30 Sep 2024 20:10:58 +0200 Subject: [PATCH 2/2] corrections --- cpctelera/src/keyboard/cpct_isAnyKeyPressed.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpctelera/src/keyboard/cpct_isAnyKeyPressed.s b/cpctelera/src/keyboard/cpct_isAnyKeyPressed.s index 51389f652..ad5ff6617 100644 --- a/cpctelera/src/keyboard/cpct_isAnyKeyPressed.s +++ b/cpctelera/src/keyboard/cpct_isAnyKeyPressed.s @@ -52,11 +52,11 @@ ;; Next code example shows how to use this function in conjunction with . ;; ;; (start code) -;; any_key_pressed() { +;; u8 any_key_pressed() { ;; u8 key_pressed; // Declares symbol ;; cpct_scanKeyboard(); // Updates the keyboard status ;; key_pressed = cpct_isAnyKeyPressed(); // Checks if any key is pressed, and -;; // returns a number not 0 if a key is pressed. +;; return key_pressed; // returns a number not 0 if a key is pressed. ;; } ;; (end code) ;; Destroyed Register values: