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 / 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
@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 = []
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)
@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
;----------------------
; Star Castle
; By Scott Williamson
; Started 2/6/2008
; CX2655
;----------------------
;
; TODO
;
;----------------------
// 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? */
@sehugg
sehugg / CPU.ASM
Created January 7, 2017 14:06
An Apple ][ emulator in 8086 assembler
name cpu
.model large
EXTRN _rwts
.data
EXTRN _memseg:DWORD
.code
; *** EQUATES
acc equ cl
'''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'