Skip to content

Instantly share code, notes, and snippets.

@nurpax
nurpax / Load_Line.sid
Last active July 29, 2019 22:10
c64jasm content example in a gist
@nurpax
nurpax / main.asm
Last active July 29, 2019 19:22
c64jasm sprites example in a gist
!include "c64.asm"
; C64jasm example program
;
; see https://github.com/nurpax/c64jasm/tree/master/examples for more
!let SIN_LEN = 64
!let zptmp0 = $20
@nurpax
nurpax / main.asm
Last active July 26, 2019 21:53
c64jasm gist example 1
!include "c64.asm"
+c64::basic_start(entry)
entry: {
lda #0
}
; try includes
!include "other.asm"
const urlParams = new URLSearchParams(window.location.search);
const myParam = urlParams.get('gist_id');
console.log(myParam);
console.log(process.env.PUBLIC_URL);
fetch('https://api.github.com/gists/5cbb8438e12add2d8cd1723c7459e0ec')
.then(resp => resp.json())
.then(json => console.log(json));
!include "c64.asm"
+c64::basic_start(entry)
!let zp = {
tmp0: $20,
tmp1: $22,
sprite_idx: $24
}
const _getExpensiveThing = () => {
const c: any = getExpensiveThing;
if (c.cache) {
return c.cache;
}
c.cache = expensiveThing();
return c.cache;
}
@nurpax
nurpax / 64c.js
Last active March 26, 2019 22:58
// loader for .64c font files
module.exports = ({readFileSync, resolveRelative}, filename) => {
const buf = readFileSync(resolveRelative(filename.lit));
const numChars = (buf.length - 2) / 8;
const data = [];
let offs = 2;
for (let i = 0; i < numChars; i++) {
const c = [];
for (let bi = 0; bi < 8; bi++) {
interface Matrix3x3 {
v: number[];
}
function c(a: Matrix3x3, col: number): number[] {
return [a.v[col], a.v[col + 3], a.v[col + 6]];
}
function r(a: Matrix3x3, row: number): number[] {
return [a.v[row*3+0], a.v[row*3+1], a.v[row*3+2]];
@nurpax
nurpax / package.json
Created December 24, 2018 23:47
run .ts file in petmate (pets target)
"scripts": {
"dev": "yarn react-scripts start",
"build": "react-scripts build",
"start": "concurrently \"cross-env BROWSER=none yarn react-scripts start\" \"wait-on http://localhost:3000 && electron .\"",
"debug": "concurrently \"cross-env BROWSER=none yarn react-scripts start\" \"wait-on http://localhost:3000 && electron --remote-debugging-port=9223 .\"",
"package": "electron-builder --dir",
"dist": "npx build --x64 --macos --win --linux --c.extraMetadata.main=build/electron.js -p never",
"pets": "ts-node -O '{\"module\": \"commonjs\"}' ./src/utils/importers/png2petscii"
},
@nurpax
nurpax / CMakeLists.txt
Last active December 20, 2018 03:14
cmake c++11 project
cmake_minimum_required (VERSION 2.6)
project (example)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_executable(example main.cpp)