Skip to content

Instantly share code, notes, and snippets.

@ligfx
ligfx / gist:02c5832fd6ee8af3e94765b769d933bb
Last active February 26, 2024 16:32
Creatures Docking Station on macOS
  1. Download the Windows version of Creatures Docking Station from http://www.creaturesdockingstation.com/
  2. Create an SDL install: decompress the files, combining files from dsbuild 195/global and dsbuild 195/win32_sdl
  3. Install Wine with brew install --no-quarantine gcenx/wine/wine-crossover
  4. Run with cd "Docking Station"; SDL_VIDEODRIVER=windib wine32on64 engine.exe (sound will fail, if you want sound run with SDL_VIDEODRIVER=windib WINEPREFIX=~/.wine32 WINEARCH=win32 wine32on64 engine.exe) (apparently now I can just run SDL_VIDEODRIVER=windib wine engine.exe with Wine Crossover and it works, including sound)
@ligfx
ligfx / revelation.py
Last active December 27, 2020 16:00
revelation.py: extract .agents files
import errno
import os
import re
import struct
import sys
import zlib
if sys.version_info.major == 2:
from StringIO import StringIO as BytesIO
else:
@ligfx
ligfx / c1_scriptorium_from_eden_sfc_openc2e.cos
Last active December 19, 2020 20:33
c1_scriptorium_from_eden_sfc_openc2e.cos
* Toplevel scriptorium
scrp 0 0 0 17,targ _it_,doif dead ne 0,stop,endi,targ ownr,doif gnus eq 2,impt 6,appr,touc,anim [33343334],snde punc,mesg writ _it_ 2,stim writ targ 0 0 0 0 34 55 43 30 22 30 0 0,stim writ _it_ 0 0 0 0 17 30 26 30 69 20 0 0,stop,else,targ _it_,doif gnus eq 2,setv var0 1,else,setv var0 0,endi,targ ownr,doif var0 eq 1,impt 3,appr,anim [33343334],snde spnk,mesg writ _it_ 0,stop,endi,endi,setv var0 0,doif spcs eq 1,addv var0 1,endi,doif chem 13 gt 128,addv var0 1,endi,setv var2 spcs,targ _it_,doif spcs ne var2,addv var0 1,setv var1 1,endi,doif cage ge 2,addv var0 1,endi,targ ownr,doif var0 eq 4,impt 3,aim: 0,appr,pose 37,wait 5,snde kis2,mesg writ _it_ 0,doif totl 4 1 0 lt 12,f**k,endi,stim writ targ 0 0 0 0 45 255 34 100 22 40 23 60,stim writ _it_ 32 0 0 0 45 255 34 100 22 40 23 60,wait 15,pose 12,wait 20,done,else,impt 3,aim: 0,appr,doif var1 eq 1,pose 37,wait 5,snde kis1,endi,mesg writ _it_ 0,stm# writ targ 13,wait 15,pose 12,wait 20,done,endi,endm
scrp 0 0 0 18,targ _it_,doif dead ne 0,
@ligfx
ligfx / whatsinthiszipfile.py
Created June 9, 2020 01:25
what's in this zip file
# encoding: utf-8
import os.path
import sys
import zipfile
def file_to_gamenames(filename, f):
extension = filename.split(".")[-1].lower()
**CAOS2PRAY
*# Pray-File "elevines.agents"
*# DS-Name "Elevines"
*# Depend blnk.c16
*# attach elevinehelp.catalogue elevines.c16
*# desc = "An easy-to-use custom elevator system. Read the help file included for details. Lovely sprites by Mea."
*# Agent Animation File = "elevines.c16"
*# Agent Sprite First Image = 4
*# Agent Animation Gallery = "elevines"
*# Web URL = "naturingnurturing.blogspot.com"
**CAOS2PRAY
*# Pray-File "elevines.agents"
*# DS-Name "Elevines"
*# Depend blnk.c16
*# attach elevinehelp.catalogue elevines.c16
*# desc = "An easy-to-use custom elevator system. Read the help file included for details. Lovely sprites by Mea."
*# Agent Animation File = "elevines.c16"
*# Agent Sprite First Image = 4
*# Agent Animation Gallery = "elevines"
*# Web URL = "naturingnurturing.blogspot.com"
import glob
import re
files = (
glob.glob("src/**/*.c", recursive=True)
+ glob.glob("src/**/*.cpp", recursive=True)
+ glob.glob("src/**/*.re2c", recursive=True)
+ glob.glob("src/**/*.h", recursive=True)
+ glob.glob("src/**/*.hpp", recursive=True)
)
import struct
FIELD_BASE_TYPES_TO_NAMES = {
0x0: 'enum',
0x1: 'sint8',
0x2: 'uint8',
0x7: 'string',
0x84: 'uint16',
0x85: 'sint32',
// Helper class for describing binary formats like FIFO log files. Create a
// subclass and implement Describe(...), then call ::Read or ::Write on it.
// Curiously-recurring template pattern
template <typename Derived>
class BinaryFormatDescription
{
template <typename T>
struct is_simple
{
include(GetPrerequisites)
function(STARTSWITH string prefix outvar)
string(FIND "${string}" "${prefix}" _prefix_location)
if("${_prefix_location}" EQUAL 0)
set("${outvar}" TRUE PARENT_SCOPE)
else()
set("${outvar}" FALSE PARENT_SCOPE)
endif()
endfunction()