Skip to content

Instantly share code, notes, and snippets.

View superzazu's full-sized avatar
🐷

superzazu superzazu

🐷
  • France
  • 14:48 (UTC +01:00)
View GitHub Profile
@superzazu
superzazu / 8080PRE.COM.TXT
Created May 14, 2021 12:31
8080PRE.COM execution log
*** TEST: cpu_tests/8080PRE.COM
PC: 0100, AF: 0002, BC: 0000, DE: 0000, HL: 0000, SP: 0000, CYC: 0 (3E 01 FE 02)
PC: 0102, AF: 0102, BC: 0000, DE: 0000, HL: 0000, SP: 0000, CYC: 7 (FE 02 CA 00)
PC: 0104, AF: 0187, BC: 0000, DE: 0000, HL: 0000, SP: 0000, CYC: 14 (CA 00 00 FE)
PC: 0107, AF: 0187, BC: 0000, DE: 0000, HL: 0000, SP: 0000, CYC: 24 (FE 01 C2 00)
PC: 0109, AF: 0156, BC: 0000, DE: 0000, HL: 0000, SP: 0000, CYC: 31 (C2 00 00 C3)
PC: 010C, AF: 0156, BC: 0000, DE: 0000, HL: 0000, SP: 0000, CYC: 41 (C3 11 01 76)
PC: 0111, AF: 0156, BC: 0000, DE: 0000, HL: 0000, SP: 0000, CYC: 51 (CD 17 01 C3)
PC: 0117, AF: 0156, BC: 0000, DE: 0000, HL: 0000, SP: FFFE, CYC: 68 (E1 7C FE 01)
PC: 0118, AF: 0156, BC: 0000, DE: 0000, HL: 0114, SP: 0000, CYC: 78 (7C FE 01 CA)
@superzazu
superzazu / TST8080.COM.TXT
Created May 14, 2021 12:30
TST8080.COM execution log
*** TEST: cpu_tests/TST8080.COM
PC: 0100, AF: 0002, BC: 0000, DE: 0000, HL: 0000, SP: 0000, CYC: 0 (C3 B2 01 4D)
PC: 01B2, AF: 0002, BC: 0000, DE: 0000, HL: 0000, SP: 0000, CYC: 10 (31 BD 07 21)
PC: 01B5, AF: 0002, BC: 0000, DE: 0000, HL: 0000, SP: 07BD, CYC: 20 (21 03 01 CD)
PC: 01B8, AF: 0002, BC: 0000, DE: 0000, HL: 0103, SP: 07BD, CYC: 30 (CD 4B 01 E6)
PC: 014B, AF: 0002, BC: 0000, DE: 0000, HL: 0103, SP: 07BB, CYC: 47 (D5 EB 0E 09)
PC: 014C, AF: 0002, BC: 0000, DE: 0000, HL: 0103, SP: 07B9, CYC: 58 (EB 0E 09 CD)
PC: 014D, AF: 0002, BC: 0000, DE: 0103, HL: 0000, SP: 07B9, CYC: 62 (0E 09 CD 05)
PC: 014F, AF: 0002, BC: 0009, DE: 0103, HL: 0000, SP: 07B9, CYC: 69 (CD 05 00 D1)
PC: 0005, AF: 0002, BC: 0009, DE: 0103, HL: 0000, SP: 07B7, CYC: 86 (D3 01 C9 00)
@superzazu
superzazu / ghidra_mac.sh
Created May 5, 2021 12:34
makes a self-contained .app bundle for Ghidra 9.2.3 on macOS 11+ (ARM)
#!/bin/zsh
# ghidra_mac: makes a self-contained .app bundle for Ghidra 9.2.3 on macOS 11+ (ARM)
curl https://ghidra-sre.org/ghidra_9.2.3_PUBLIC_20210325.zip -o ghidra.zip
# https://www.azul.com/downloads/zulu-community/?version=java-11-lts&os=macos&package=jdk
curl https://cdn.azul.com/zulu/bin/zulu11.48.21-ca-jdk11.0.11-macosx_aarch64.tar.gz -o jdk.tar.gz
mkdir Ghidra.app
mkdir -p Ghidra.app/Contents/MacOS
@superzazu
superzazu / sdl2_pixelbuffer.c
Last active August 7, 2023 12:21
Displaying an array of pixels onto the screen in C99 with the SDL2
#include <stdio.h>
#include <stdbool.h>
#include <SDL.h>
#define WIN_WIDTH 160
#define WIN_HEIGHT 144
int main(int argc, char **argv) {
// SDL init
@superzazu
superzazu / sdl2_sinewave.c
Created May 29, 2019 07:24
Playing a sine wave with the SDL2
#include <stdio.h>
#include <SDL.h>
int main(void) {
SDL_Init(SDL_INIT_AUDIO);
// the representation of our audio device in SDL:
SDL_AudioDeviceID audio_device;
// opening an audio device:
@superzazu
superzazu / bedinst.sh
Last active May 20, 2019 11:49
Debian/Ubuntu installer for Minecraft (Bedrock edition)
#!/usr/bin/env bash
# bedinst.sh: Minecraft bedrock server installer for Ubuntu
# example: $ bash bedinst.sh 1.11.2.1 output/
# see https://www.minecraft.net/en-us/download/server/bedrock/
if [[ $# -ne 2 ]]; then
echo "usage: $0 version output_folder" >&2
echo "usage: example: $0 1.11.2.1 output/"
exit 1
fi
@superzazu
superzazu / MakefileCXX
Last active September 22, 2019 10:04
Minimal Makefile for C++ projects
bin = my_program_name
src = $(wildcard *.cpp)
obj = $(src:.cpp=.o)
CXXFLAGS = -g -Wall -Wextra -O2 -std=c++11 -pedantic $(shell pkg-config --cflags sdl2 SDL2_mixer)
LDFLAGS = $(shell pkg-config --libs sdl2 SDL2_mixer)
.PHONY: all clean
all: $(bin)
@superzazu
superzazu / Makefile
Last active September 22, 2019 10:12
Minimal Makefile for C projects
bin = my_program_name
src = $(wildcard *.c)
obj = $(src:.c=.o)
CFLAGS = -g -Wall -Wextra -O2 -std=c99 -pedantic
LDFLAGS =
.PHONY: all clean
all: $(bin)
@superzazu
superzazu / rsntotarxz.sh
Last active September 13, 2018 17:34
Create a .tar.xz file from a .rsn file (SNES music file)
#!/usr/bin/env bash
# create .tar.xz out of a .rsn file
set -e
if [[ $# -ne 2 ]]; then
echo "usage: rsntotarxz input.rsn output.tar.xz" >&2
exit 1
fi
@superzazu
superzazu / PICO-8.sublime-build
Created July 16, 2018 21:05
PICO-8 Sublime Text 3 build
{
"cmd": ["/Applications/PICO-8.app/Contents/MacOS/pico8", "-run", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.p8"
}