This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// drop in to sdl3_template for a fixed framebuffer experience | |
// | |
#include <SDL3/SDL.h> | |
#include <SDL3/SDL_main.h> | |
#include <SDL3/SDL_stdinc.h> | |
#include <math.h> | |
// "game" size | |
#define APP_WIDTH 384 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct _list_t_ | |
{ | |
struct _list_t_ *prev,*next; | |
} _list_t_; | |
#define list_add(list, obj) ({ ((_list_t_ *)obj)->next = list; ((_list_t_ *)obj)->prev = NULL; if (list != NULL) list->prev = obj;list = (_list_t_ *)obj;}) | |
#define list_del(list, obj) ({ if (((_list_t_ *)obj)->next) ((_list_t_ *)obj)->next->prev = ((_list_t_ *)obj)->prev; if (((_list_t_ *)obj)->prev) ((_list_t_ *)obj)->prev->next = ((_list_t_ *)obj)->next; else list = ((_list_t_ *)obj)->next;}) | |
#define list_for(Y,X) for (_list_t_ *Y=X;Y!=NULL;Y=Y->next) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "raylib.h" | |
// printf("%s\n",toString((Vector3}(1,2,3)); | |
// {1.0000,2.000,3.000} is printed | |
// toString can be used with any of the variable types below | |
#define toString(X) _Generic((X), \ | |
Vector2 : TextFormat("{%f,%f}",X.x,X.y), \ | |
Vector3 : TextFormat("{%f,%f,%f}",X.x,X.y,X.z), \ | |
Vector4 : TextFormat("{%f,%f,%f,%f}",X.x,X.y,X.z,X.w), \ | |
Rectangle : TextFormat("{%f,%f,%f,%f}",X.x,X.y,X.width,X.height), \ | |
Color : TextFormat("{0x%02X,0x%02X,0x%02X,0x%02X}",X.r,X.g,X.b,X.a), \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// build with | |
// millfork -t c64 state.mfk | |
// an example of using a state machine type interface in Millfork | |
// each entity has a STATE. | |
// each state contains | |
// an entry action: performed when entering the state, and | |
// an exit action: performed when exiting the state, and | |
// an updata action: performed once per frame while the state is active | |
// here you can change state by simply setting ``next_state = target_state.pointer`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys, platform, string, getopt | |
import numpy as np | |
from scipy import ndimage | |
import matplotlib.pyplot as plt | |
from PIL import Image, ImageSequence, ImageDraw | |
# yes hardcoded filenames. whatevs :P | |
# load image | |
sourceimage = Image.open("test2.png") | |
pal = sourceimage.getpalette() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compile with OSCAR64 | |
// | |
// oscar64.exe -tm=nes -n boot.c -O2 -o=bin\boot.nes | |
// https://github.com/drmortalwombat/oscar64 | |
#include <nes/nes.h> | |
#include <nes/neslib.h> | |
extern char PAL_BUF[32]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include "tigr.h" | |
#include "vec2.h" | |
// extension of this code | |
// https://github.com/gustavopezzi/triangle-rasterizer-float |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TILED plugin | |
// NES experiment, loading .CHR files and being able to edit the four palettes and update the tileset dynamically. | |
// 1st play with the new JS api for Tiled | |
var NESToolState = { | |
dialogOpen: false, | |
chosenAction: null, | |
chosenIndex: null, | |
image: null, | |
tileset: null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Drawing; | |
using CharactorLib.Common; | |
using CharactorLib.Format; | |
namespace ncm_16x8 | |
{ | |
public class ncm_16x8 : FormatBase | |
{ | |
public ncm_16x8() |
NewerOlder