Skip to content

Instantly share code, notes, and snippets.

View BlockoS's full-sized avatar
💭
🧙⚔️💾

MooZ BlockoS

💭
🧙⚔️💾
View GitHub Profile
@BlockoS
BlockoS / openDisplay.c
Created December 9, 2009 20:57
Smallest possible raw X11 init
//// TODO :: 3. Clean up
//// 4. Events
//// 5. Create a colormap
//// 6. glx ?
#ifdef DEBUG
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/un.h>
#include <sys/select.h>
@BlockoS
BlockoS / CMakeLists.txt
Last active July 31, 2020 20:59
PCE 16 colors conversion using kmeans++ and CIE Lab
cmake_minimum_required (VERSION 3.12)
project(palette C)
add_library(stb_image STATIC stb_image.c stb_image.h stb_image_write.h)
add_executable(kmeans kmeans.c)
target_compile_options(kmeans PUBLIC -Wall -Wshadow -Wextra)
target_link_libraries(kmeans stb_image m)
@BlockoS
BlockoS / huvideo.asm
Created May 4, 2020 21:50
Galaxy Fraulein Yuna HuVideo
; etripator -l syscard.json huvideo.json Galaxy\ Fraulein\ Yuna\ HuVideo\ CD\ \(JP\).img
.code
.bank $068
.org $4b50
vram_load:
st0 #$00
lda <$44
sta video_data_l
lda <$45
sta video_data_h
@BlockoS
BlockoS / main.c
Last active January 23, 2019 20:25
ternary op stuff
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
int c = 0;
int j = (argc > 1) ? (printf("plop "),c=1,-1) : 1;
printf("%d %d\n", j, c);
return EXIT_SUCCESS;
}
@BlockoS
BlockoS / EPOCH.DIS_w_Comments.a78.txt
Created November 13, 2018 22:57
Chris Covell Pokekon docs
;"Pokekon" BIOS disassembly & comments by Chris Covell
; This is a disassembly of the Epoch Game Pocket Computer's BIOS ROM.
; The BIOS is internal to the uPD78c06 CPU, but is completely accessible to
; all game ROMs, and provides vital support functions for games (reading
; the joypad, updating the LCD, offering music-playing routines...)
;
; Not all of the functions of the BIOS are understood, but a good many
; of them have been documented. Much of the ROM space is taken up by
; the internal demonstration, puzzle, and "paint" programs of the Pokekon
@BlockoS
BlockoS / fail.asm
Last active April 2, 2018 20:34
:(
; ex af, af'
; add ix, de ; 15 ix += de
; exx
; ld a,ixh ; 4 a = hi(ix)
; and 31 ; 7 a &= 31
;
; xor l ; 4 l = 0
; ld h,a ; 4 h = a
; srl h ; 8 lsr h
; rr l ; 8 ror l
@BlockoS
BlockoS / system_hudson.ipl
Created December 23, 2017 14:44
First 0x326 bytes of the 1st sector of the 2nd track
このプログラムの著作権は株式会社
ハドソンが所有しております。この
プログラムの一部または全部を株式
会社ハドソンの書面による許可なく
複写・複製・転用することは著作権
法により禁じられております。
PRODUCER 中本伸一
DIRECTOR 野沢勝広
CD-ROM SIMULATOR 本迫芳夫
BIOS MAIN CODE, CD-PLAYER 小林敬樹
@BlockoS
BlockoS / heart.c
Created July 3, 2016 21:01
Create heart shaped dots.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <utils/print.h>
int main()
{
int total = 96;
@BlockoS
BlockoS / lzss.am
Created January 31, 2016 20:43
LZSS pcengine unpacker
;;------------------------------------------------
;; Compressed image loading (lzss)
;; (c) 2005,2006 Vincent "MooZ" Cruz
;; cruz.vincent@gmail.com
;;------------------------------------------------
HUC = 1
;;------------------------------------------------
;; LZSS
@BlockoS
BlockoS / aslw.asm
Last active December 21, 2015 21:49
HuC6280 left shift (8bit input, 16bit output)
;----------------------------------------------------------------------
; name : asl.w
;
; description : Left shift 8 bit value, 16 bit result
;
; in : A number of bits to shift [0-f]
; X value
;
; out: A low nibble
; Y high nibble