fix chip8 key press
This commit is contained in:
6
LICENSE
6
LICENSE
@@ -1,4 +1,4 @@
|
|||||||
BSD 3-Clause License
|
BSD 2-Clause License
|
||||||
|
|
||||||
Copyright (c) 2025-2026, Antoni Piasecki
|
Copyright (c) 2025-2026, Antoni Piasecki
|
||||||
|
|
||||||
@@ -12,10 +12,6 @@ modification, are permitted provided that the following conditions are met:
|
|||||||
this list of conditions and the following disclaimer in the documentation
|
this list of conditions and the following disclaimer in the documentation
|
||||||
and/or other materials provided with the distribution.
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
3. Neither the name of the copyright holder nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
|||||||
2
chip8.c
2
chip8.c
@@ -345,7 +345,7 @@ void chip8_step(CHIP8 *c) {
|
|||||||
break;
|
break;
|
||||||
case 0x0A: {
|
case 0x0A: {
|
||||||
uint8_t key_pressed = 0;
|
uint8_t key_pressed = 0;
|
||||||
while (!key_pressed && WindowShouldClose()) {
|
while (!key_pressed && !WindowShouldClose()) {
|
||||||
for (size_t i = 0; i < 16; i++) {
|
for (size_t i = 0; i < 16; i++) {
|
||||||
if (IsKeyDown(keyboard_map[i])) {
|
if (IsKeyDown(keyboard_map[i])) {
|
||||||
key_pressed = 1;
|
key_pressed = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user