Skip to content

Instantly share code, notes, and snippets.

import xml.parsers.expat
import sys,gzip,string
_name = ''
_manf = ''
_year = 0
_desc = ''
_srcfile = ''
_tag = None
_cpus = []
@sehugg
sehugg / mamexml.py
Last active June 25, 2021 18:41
generates list of supported mame games in XML (requires mame binary)
import xml.parsers.expat
import sys,gzip,string
_name = ''
_manf = ''
_year = 0
_desc = ''
_srcfile = ''
_tag = None
_cpus = []
@sehugg
sehugg / xygoto.c
Created May 23, 2020 16:50
Workaround gotoxy() kernel crash in C64 open source BIOS
#include <stdio.h>
#include <conio.h>
#include <c64.h>
#include <cbm_petscii_charmap.h>
void xygoto(char x, char y) {
x=x; y=y; // to avoid "unused variable" warning
__asm__ ("jsr popa");
__asm__ ("tax"); // pop X
import json
import dateutil.parser
with open('nvdcve.json','r') as f:
root = json.load(f)
items = root['CVE_Items']
items = sorted(items, key=lambda k: dateutil.parser.parse(k.get('publishedDate', '')), reverse=True)
;----------------------
; Star Castle
; By Scott Williamson
; Started 2/6/2008
; CX2655
;----------------------
;
; TODO
;
;----------------------
@sehugg
sehugg / README.md
Created January 26, 2019 18:45
SCRIPT-8
@sehugg
sehugg / happy2019.bas
Last active December 31, 2018 18:59
Happy 2019 demo in batariBASIC
set kernel_options no_blank_lines pfcolors
set romsize 8kSC
set smartbranching on
const pfres=18
pfclear
rem make sprites go behind playfield
CTRLPF = %00000101
@sehugg
sehugg / nietz_stateful.py
Last active October 16, 2017 19:45
Stateful LSTM text generation with Keras 1.0
#!/usr/bin/env python
from __future__ import print_function
from keras.models import Sequential
from keras.layers import TimeDistributed
from keras.layers.core import Dense, Activation, Dropout, RepeatVector, TimeDistributedDense
from keras.layers.recurrent import LSTM
from keras.utils.data_utils import get_file
import numpy as np
import random,string
import sys
'''Test of stateful LSTM.
This trains a LSTM to convert a frequency-modulated signal to a sine wave.
The period of the signal is greater than the temporal dimension of the LSTM,
so in theory the stateful version should have an advantage.
'''
from __future__ import print_function
import os
os.environ['KERAS_BACKEND'] = 'tensorflow'
// duplicates static variable bug for CC65
#include <stdio.h>
#include <limits.h>
unsigned char success=0;
unsigned char failures=0;
unsigned char dummy=0;
#define COUNT 256 /* Up to what number? */