From 2a69d37f8e68ceebc5b45c898c57489d262d53f2 Mon Sep 17 00:00:00 2001 From: Toni Date: Sat, 12 Jul 2025 15:22:23 +0200 Subject: [PATCH] license --- 6502.c | 3 +++ LICENSE | 24 ++++++++++++++++++++++++ build.sh | 3 ++- chip8.c | 6 +++--- 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 6502.c create mode 100644 LICENSE diff --git a/6502.c b/6502.c new file mode 100644 index 0000000..79c21e3 --- /dev/null +++ b/6502.c @@ -0,0 +1,3 @@ +#include + +int main() { printf("Hello, World!\n"); } \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7ca92f8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +BSD 2-Clause License + +Copyright (c) 2025, Antoni Piasecki + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/build.sh b/build.sh index 405fcb8..6e07bbd 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,4 @@ #!/bin/bash set -xe -cc -O3 -o chip8 chip8.c -L/usr/local/lib/libraylib.a -lraylib -lm \ No newline at end of file +cc -O3 -o chip8 chip8.c -L/usr/local/lib/libraylib.a -lraylib -lm +cc -O3 -o 6502 6502.c \ No newline at end of file diff --git a/chip8.c b/chip8.c index d5bb7ed..b61f341 100644 --- a/chip8.c +++ b/chip8.c @@ -1,5 +1,4 @@ // http://devernay.free.fr/hacks/chip8/C8TECH10.HTM -// TODO: buzzer #include #include #include @@ -68,10 +67,10 @@ CHIP8 chip8_create() { void chip8_disassemble(CHIP8 *c, size_t ins_count) { for (size_t i = 0; i < ins_count; i++) { - READ_INS(); - printf("0x%x: ", c->pc); + READ_INS(); + switch ((ins >> 12) & 0xF) { case 0x0: { switch (nnn) { @@ -212,6 +211,7 @@ void chip8_step(CHIP8 *c) { } if (c->sound_timer > 0) { c->sound_timer--; + // TODO: buzzer } READ_INS();