Skip to content

Instantly share code, notes, and snippets.

View icculus's full-sized avatar

Ryan C. Gordon icculus

View GitHub Profile
@icculus
icculus / basicgorillas.rb
Last active June 21, 2023 02:10
DragonRuby Basic Gorillas
# This is the complete source code to Basic Gorillas:
# https://dragonruby.itch.io/basicgorillas
#
# You can tinker with this by getting a copy of DragonRuby Game Toolkit:
# https://dragonruby.org/
#
# Amir Rajan wrote this game, catch him at https://twitter.com/amirrajan !
class YouSoBasicGorillas
attr_accessor :outputs, :grid, :game, :inputs
# This is the complete source code to Flappy Dragon:
# https://dragonruby.itch.io/flappydragon
#
# You can tinker with this by getting a copy of DragonRuby Game Toolkit:
# https://dragonruby.org/
#
# Amir Rajan wrote this game, catch him at https://twitter.com/amirrajan !
class FlappyDragon
attr_accessor :grid, :inputs, :game, :outputs
@icculus
icculus / mame-emscripten-errors.txt
Created October 26, 2017 18:41
Running out of memory linking Emscripten MAME...
Linking mame.bc...
WARNING:root:emcc: cannot find library "util"
WARNING:root:emcc: cannot find library "SDL2_ttf"
Running post-build commands
/Users/icculus/Desktop/emsdk_portable/emscripten/1.37.9/emcc -O3 -s USE_SDL=2 -s USE_SDL_TTF=2 --memory-init-file 0 -s ALLOW_MEMORY_GROWTH=0 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=2 -s EXCEPTION_CATCHING_WHITELIST='["__ZN15running_machine17start_all_devicesEv","__ZN12cli_frontend7executeEiPPc"]' -s EXPORTED_FUNCTIONS="['_main', '_malloc', '__ZN15running_machine30emscripten_get_running_machineEv', '__ZN15running_machine17emscripten_get_uiEv', '__ZN15running_machine20emscripten_get_soundEv', '__ZN15mame_ui_manager12set_show_fpsEb', '__ZNK15mame_ui_manager8show_fpsEv', '__ZN13sound_manager4muteEbh', '_SDL_PauseAudio', '_SDL_SendKeyboardKey', '__ZN15running_machine15emscripten_saveEPKc', '__ZN15running_machine15emscripten_loadEPKc', '__ZN15running_machine21emscripten_hard_resetEv', '__ZN15running_machine21emscripten_soft_resetEv', '__ZN15running_machine15
@icculus
icculus / sdl-vulkan-explanation.cpp
Created September 3, 2017 18:47
SDL vulkan explanation...
/*
Ok, I answered too quickly, and Twitter is terrible for this, so have a gist.
You call this function twice: the first time with a NULL and it just sets
extension_count to the number of strings it plans to give you, so you can
allocate space for them and call the function again.
*/
// (you should check return values for errors in all this, but whatever.)
unsigned int count = 0;
#!/bin/bash
#
# SDL 2.0.4 Bug-"Count" Checker for Mac OS X or KDE
# Version 1.6
#
# Requirements:
# - any one of the following command-line notification tools:
# - Growl and growlnotify, for Mac OS X, available at http://growl.info
# - kdialog, for KDE
# - notify-send, for generic Linux notifications