Skip to content

Instantly share code, notes, and snippets.

View deckarep's full-sized avatar
🎯
Focusing

Ralph Caraveo deckarep

🎯
Focusing
View GitHub Profile
@deckarep
deckarep / ExtractWavs.py
Created June 28, 2024 17:34
Extracts all .wav audio from Leisure Suit Larry Casino - originally written by @Doomlazer
# Original credit: @doomlazer
# https://github.com/Doomlazer/TrivialQuest/blob/main/audio/jokes/ExtractWavs.py
# Extract wav files from Larry's Casino audio.vol
# Sound effects can also be dumped from resources.vol
# jokes are 71.wav - 183.wav
#
# command to convert wav to mp3:
# for f in *.wav; do ffmpeg -i "$f" "${f%.wav}.mp3"; done
import struct
@deckarep
deckarep / rmSidewalk.py
Last active January 25, 2024 19:11
WTF - SCI Script to Python3 - experiment to modernize the SCI source code...
# Hello, before anyone freaks out this is just an experiment...to see how far the rabbit hole can go.
# Original .sc file for ref: https://github.com/EricOakford/SCI-Decompilation-Archive/blob/master/lsl1/src/rmSidewalk.sc
# SCI script is really interesting to me, but largely outdated
# Based on a combination of Small-Talk and Lisp, with Prefix notation for expressions...it can get unwieldy
# to read at least for me. Boat-load of paranthesis and expressions that don't read like normal infix notation.
# But,
@deckarep
deckarep / align_asm.py
Created November 10, 2023 02:02
A quick and dirty work-in-progress script that can help align blocks of assembly language since doing it manually is tedious and boring and hurts my eyes.
#!/usr/bin/env python3
import sys
class NasmAligner:
def __init__(self, start_address=0):
self.alignments = {'DB': 1, 'DW': 2, 'DD': 4, 'DQ': 8}
self.output_lines = []
self.current_address = start_address
@deckarep
deckarep / alignof.py
Created November 9, 2023 04:57
A stupid simple Python utility to quickly print out the alignment of an integer provided on the command line.
import sys
def check_alignment(val):
alignments = {
'2-byte': val & 0x1 == 0,
'4-byte': val & 0x3 == 0,
'8-byte': val & 0x7 == 0,
'16-byte': val & 0xF == 0,
'32-byte': val & 0x1F == 0,
'64-byte': val & 0x3F == 0,
@deckarep
deckarep / main.go
Last active October 11, 2022 20:28
KQ6 - Hires Portrait Extractor
package main
import (
"encoding/binary"
"fmt"
"image"
"image/color"
"image/png"
"io/ioutil"
"log"
@deckarep
deckarep / rand.6502.asm
Created January 23, 2021 06:49
6502 assembly - simple RAND subroutine
rand equ $04
;uint8_t next_rnd(void)
;{
; static uint8_t rnd;
; rnd = rnd * 5 + 17;
; return rnd;
;}
; returns a pseudo rand store at memory location: rand
@deckarep
deckarep / main.go
Created July 2, 2020 01:23
Protobuf Talk: Populating and serializing a dog into bytes
package main
// to run: go run *.go
import (
fmt "fmt"
"log"
proto "github.com/gogo/protobuf/proto"
)
@deckarep
deckarep / dog.proto
Created July 2, 2020 01:22
Protobuf Talk: Dog schema definition
syntax = "proto2";
option go_package = "main";
message Dog {
required int32 owner_id= 1;
optional string breed = 2;
optional float height_in = 3;
optional string color = 4;
}
@deckarep
deckarep / dog.pb.go
Last active July 2, 2020 01:26
Protobuf Talk: Output of protoc command.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: dog.proto
package main
import (
encoding_binary "encoding/binary"
fmt "fmt"
github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
proto "github.com/gogo/protobuf/proto"
@deckarep
deckarep / keybase.md
Created March 18, 2019 17:23
My keybase ya’ll

Keybase proof

I hereby claim:

  • I am deckarep on github.
  • I am deckarep (https://keybase.io/deckarep) on keybase.
  • I have a public key ASCILfCZPwyCR_n1T7aot_Nq9xjLhXrkYoKZRX-deNXGrwo

To claim this, I am signing this object: