This file contains 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
local sfxcache = { | |
channel=1, -- the channel to check (1-4) | |
beats=8, -- fire on every nth beat (0, 4, 8, or 16) | |
sfx={}, | |
valid=true, | |
play=function(self,...) | |
add(self.sfx,{...}) | |
end, | |
check=function(self) | |
if stat(19+self.channel)%self.beats==0 then |
This file contains 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
<?php | |
$strRoot = "C:\\Users\\Neil\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\"; | |
$strMain = file_get_contents($argv[1]); | |
if (preg_match_all('/^require \"(.+?)\"$/m', $strMain, $arrMatches)) { | |
foreach ($arrMatches[1] as $i => $strFile) { | |
$strPath = $strRoot . '\\' . str_replace(["carts/", "\/"], ["", "\\"], $strFile) . ".lua"; | |
$strRequire = file_get_contents($strPath); | |
$strRequire = trim($strRequire) . "\n"; |
This file contains 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
<?php | |
const TIC_MAP_WIDTH = 240; | |
const TIC_MAP_HEIGHT = 136; | |
const PICO_MAP_WIDTH = 128; | |
const PICO_MAP_HEIGHT = 32; | |
function tic80_map_file_to_p8($strMapFile, $strPicoFile) | |
{ |
This file contains 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
local sprf={} | |
function fget(s,i) | |
if sprf[s+1]==nil then sprf[s+1]=0 end | |
if i==nil then | |
return math.floor(sprf[s+1]) | |
else | |
local b=2^i | |
return sprf[s+1] % (2*b) >= b | |
end |