Skip to content

Instantly share code, notes, and snippets.

@realmonster
realmonster / aero_map.py
Created Jul 24, 2018
Aero the Acro-Bat 2 (GEN) map converter into png
View aero_map.py
# Aero the Acro-Bat 2 (GEN) map converter into png
# for python 2.x
# by r57shell@uralweb.ru
# 24.07.2018
from PIL import Image, ImageDraw, ImageFont
from struct import *
import sys
import math
View crt-royale-pal-r57shell.cgp
# IMPORTANT:
# Shader passes need to know details about the image in the mask_texture LUT
# files, so set the following constants in user-cgp-constants.h accordingly:
# 1.) mask_triads_per_tile = (number of horizontal triads in mask texture LUT's)
# 2.) mask_texture_small_size = (texture size of mask*texture_small LUT's)
# 3.) mask_texture_large_size = (texture size of mask*texture_large LUT's)
# 4.) mask_grille_avg_color = (avg. brightness of mask_grille_texture* LUT's, in [0, 1])
# 5.) mask_slot_avg_color = (avg. brightness of mask_slot_texture* LUT's, in [0, 1])
# 6.) mask_shadow_avg_color = (avg. brightness of mask_shadow_texture* LUT's, in [0, 1])
# Shader passes also need to know certain scales set in this .cgp, but their
@realmonster
realmonster / NES_NTSC_composite_Bisqwit.cg
Last active Apr 13, 2018
NES NTSC composite signal simulation for RetroArch, algo by Bisqwit
View NES_NTSC_composite_Bisqwit.cg
// NES NTSC composite signal CRT simulation for RetroArch
// implementation of algorithm by Bisqwit
// shader by r57shell
// thanks to feos & HardWareMan
// also TV subpixels and scanlines
void main_vertex
(
float4 position : POSITION,
@realmonster
realmonster / CRT3.cg
Last active Apr 19, 2018
NOT Ideal NTSC composite cable CRT simulation for RetroArch
View CRT3.cg
// NOT Ideal NTSC composite cable CRT simulation for RetroArch <- fix of title.
// by r57shell
// thanks to feos & HardWareMan
// ideal in terms of ideal encoding/decoding,
// also, without any passbands.
// also TV subpixels and scanlines
void main_vertex
(
@realmonster
realmonster / 0001-short.patch
Created Oct 7, 2017
vasm make abs short optimization
View 0001-short.patch
From 0ff1b130dce84b48b65927bde7cd433ee4649228 Mon Sep 17 00:00:00 2001
From: realmonster <r57shell@uralweb.ru>
Date: Sat, 7 Oct 2017 18:40:49 +0500
Subject: [PATCH] short
---
cpu.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/cpu.c b/cpu.c
@realmonster
realmonster / rem320.cpp
Last active Jul 25, 2017
Get remainder by 320 for old CPU
View rem320.cpp
#include <cstdio>
typedef unsigned short u16;
unsigned char table[1<<10];
void prepare()
{
for (int i=0; i<(1<<10); ++i)
table[i] = ((i%5)<<5);
@realmonster
realmonster / .block
Last active May 3, 2017
Velocity vector approximation in integers for aiming
View .block
license: mit
@realmonster
realmonster / .block
Last active Oct 20, 2016
Moon trajectory visualization
View .block
license: mit
@realmonster
realmonster / joypads.s
Last active Jan 15, 2016
Sega Genesis Test ROM with reading of Team Player and 4Way on the fly.
View joypads.s
/*
Disclaimer:
Any and all content presented in this sourcecode is
for informational and educational purposes.
You assume any and all responsibility for using this content responsibly.
It's extracted from game Street Racer, formatted, modified and commented by r57shell.
At the request of the original license holders
and developers this sourcecode will be removed.
Keywords for searching changes: was, modified, added.
@realmonster
realmonster / NES SVideo.cg
Last active Aug 29, 2015
changed to sampled mode
View NES SVideo.cg
// CG shader
// NES CRT simulation
// by r57shell
// thanks to feos & HardWareMan
void main_vertex
(
float4 position : POSITION,
out float4 oPosition : POSITION,
uniform float4x4 modelViewProj,
You can’t perform that action at this time.