Skip to content

Instantly share code, notes, and snippets.

View pvmm's full-sized avatar
🎯
Focusing

Pedro de Medeiros pvmm

🎯
Focusing
  • Brasília, DF
View GitHub Profile
Fast affine texture mapping II (fatmap2.txt)
--------------------------------------------
by
Mats Byggmastar
MRI
@pvmm
pvmm / Makefile
Created March 28, 2023 20:06
How to convert string to lowercase/uppercase using Makefile's own language
# toupper function converts value into UPPERCASE
# tolower function converts value into lowercase
_LOWER2UPPER = a:A b:B c:C d:D e:E f:F g:G h:H i:I j:J k:K l:L m:M n:N o:O p:P q:Q r:R s:S t:T u:U v:V w:W x:X y:Y z:Z
_lower = $(word 1, $(subst :, ,$(word 1,$(1))))
_upper = $(word 2, $(subst :, ,$(word 1,$(1))))
toupper = $(eval _=$1)$(strip $(foreach pair,$(_LOWER2UPPER),$(eval _=$(subst $(call _lower,$(pair)),$(call _upper,$(pair)),$_))))$_
tolower = $(eval _=$1)$(strip $(foreach pair,$(_LOWER2UPPER),$(eval _=$(subst $(call _upper,$(pair)),$(call _lower,$(pair)),$_))))$_
# end of toupper/tolower
# How to call it:
@pvmm
pvmm / truffle-material.md
Created March 16, 2023 14:06 — forked from smarr/truffle-material.md
Truffle: Languages and Material
@pvmm
pvmm / gist:59b3f19eb5da416b79cad8e066174ee6
Created January 9, 2022 22:58
SCREEN4 vertical scroll
10 SCREEN 4: COLOR 15,1,4:C%=0
20 REM Ajusta tabelas de VRAM
21 VDP(2)=&H10
22 VDP(3)=&HFF
23 VDP(11)=&H0
24 VDP(4)=&H3
25 VDP(5)=&H8F
26 VDP(12)=&H0
27 VDP(6)=&H9
@pvmm
pvmm / circle.4th
Last active September 28, 2021 20:15
Calling CIRCLE function from FORTH
\ BASIC routines
\
\ memory layout:
\ page 0-*-*-*: BIOS
\ page *-0-*-*: BASIC
\ page *-*-3-3: RAM pages
----
decimal 2 capacity 1- thru
@pvmm
pvmm / slide_tiles.py
Created May 24, 2021 18:49
Simple 8x8 tile slider
#!/usr/bin/env python3
# Slide 8x8 tiles 1 pixel at each frame to create horizontal tile animations
import os, sys
from PIL import Image
from sys import stderr
DEF_W = 8
DEF_H = 8
HEX_BASE = 16
@pvmm
pvmm / autoexec.bat
Last active September 1, 2020 13:50
Example of unit testing Fusion-C's printf() with OpenMSX
rem put this file in dsk directory along with printf.com
cls
printf
@pvmm
pvmm / gist:638da2c071173451003f9968dbb4759f
Last active August 20, 2020 01:35
jquery autocomplete example that deletes invalid input (based on jQuery UI site code)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Autocomplete - Combobox</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<style>
.custom-combobox-toggle {