This file contains hidden or 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
Game = Struct.new(:name, :path) | |
PATH_SLUG = '/storage/roms/USB/PSX/'.freeze | |
CORE_PATH = 'DETECT'.freeze | |
CORE_FRIENDLY_NAME = 'DETECT'.freeze | |
CRC_SLUG = '00000000|crc'.freeze | |
PLAYLIST_NAME = 'Sony - PlayStation.lpl'.freeze | |
games = [] | |
Dir.foreach('.') do |folder| |
This file contains hidden or 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
require 'chunky_png' | |
Texture = Struct.new(:name, :width, :height, :pixels) | |
TextureLump = Struct.new(:count, :offsets) | |
textures = [] | |
bsp = IO.read(ARGV.first, mode: "rb") | |
palette = IO.read("palette.lmp", mode: "rb") | |
tex_lump_offset = bsp[20, 4].unpack("L").first |
This file contains hidden or 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
const fs = require('fs'); | |
const pathSlug = "/storage/roms/USB/PSX/"; | |
const corePath = "DETECT"; | |
const coreFriendlyName = "DETECT"; | |
const crcSlug = "00000000|crc"; | |
const playlistName = "Sony - PlayStation.lpl"; | |
let games = []; |
This file contains hidden or 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
let canvas = document.getElementById('raster'); | |
let pgmText = document.getElementById('image-data'); | |
function renderImage() { | |
// Get text image data | |
let pattern = /[\s\n]/g; | |
// Also split on whitespace and throw away any | |
// blank entires leftover. | |
let pgmData = pgmText.value.split(pattern).filter(i => { |
This file contains hidden or 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
100 size = 10 | |
101 gfx = 5 | |
102 gr | |
103 color = gfx | |
200 dim board(size, size) | |
210 dim temp(size, size) | |
300 gosub 800 : rem random | |
310 rem main loop | |
320 gosub 900 : rem render |
This file contains hidden or 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
#turns 'rekt' into | |
#R E K T | |
#E | |
#K | |
#T | |
subject = ARGV[0].upcase | |
subject.each_char do |x| | |
print x + ' ' |
This file contains hidden or 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
require 'chunky_png' | |
#replaces magic-pink with actual transparency | |
img = ChunkyPNG::Image.from_file(ARGV.first) | |
img.height.times do |y| | |
img.width.times do |x| | |
img[x,y] = 0x00000000 if img[x,y] == 0xff00ffff | |
end |
This file contains hidden or 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
# tilesheet.rb | |
# | |
# This is for loading tile sheets that either have padding between the tiles, | |
# do not take up the whole of the image, or both. The normal Gosu method for | |
# loading from tiles doesn't work if there is padding or the tiles themselves | |
# are not wall-to-wall on the sheet. This can load such a sheet, though you | |
# will need to know how many tiles there are both wide and tall, as there's no | |
# way to guess on such a sheet. You'll also need to make sure the sheet is a | |
# power-of-two in size. You can do this by adjusting the sheet to 512x512 or | |
# 1024x1024, just add empty space if needed. |
This file contains hidden or 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 Microsoft.Xna.Framework; | |
using Microsoft.Xna.Framework.Content; | |
using Microsoft.Xna.Framework.Graphics; | |
using System; | |
namespace AdvancedWars | |
{ | |
class AnimatedSpriteSheet | |
{ | |
private string baseName; |
This file contains hidden or 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 <stdlib.h> | |
#include <stdio.h> | |
#include "stopwatch.h" | |
#include <time.h> | |
#include <omp.h> | |
int wrappedLookup(int); | |
void seedGame(char *); |
NewerOlder