This commit is contained in:
2025-07-12 15:22:23 +02:00
parent ba170f2aae
commit 2a69d37f8e
4 changed files with 32 additions and 4 deletions

3
6502.c Normal file
View File

@@ -0,0 +1,3 @@
#include <stdio.h>
int main() { printf("Hello, World!\n"); }

24
LICENSE Normal file
View File

@@ -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.

View File

@@ -1,3 +1,4 @@
#!/bin/bash
set -xe
cc -O3 -o chip8 chip8.c -L/usr/local/lib/libraylib.a -lraylib -lm
cc -O3 -o chip8 chip8.c -L/usr/local/lib/libraylib.a -lraylib -lm
cc -O3 -o 6502 6502.c

View File

@@ -1,5 +1,4 @@
// http://devernay.free.fr/hacks/chip8/C8TECH10.HTM
// TODO: buzzer
#include <raylib.h>
#include <stdint.h>
#include <stdio.h>
@@ -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();