Skip to content

Instantly share code, notes, and snippets.

View uXeBoy's full-sized avatar

Dan O'Shea uXeBoy

  • Adelaide, South Australia
View GitHub Profile
@uXeBoy
uXeBoy / BeepTest.ino
Created July 10, 2019 04:35
BeepTest.ino
#include <Arduboy2.h>
Arduboy2 arduboy;
BeepPin1 beep1;
BeepPin2 beep2;
static bool tonesPlaying = false;
static uint8_t duration = 0;
static uint8_t *tonesStart = 0;
@uXeBoy
uXeBoy / NES-controller.ino
Last active January 15, 2024 12:41
NES-controller.ino
/* Quick and dirty NES to DMG button driver (originally by Mr.Blinky)
*
* Using digital pins so it can be easily run on any Arduino
* Because DigitalRead and DigitalWrite are pretty slow, no delays are
* required when changing controller pin states and reading in data
*/
//NES button state masks
#define BS_A _BV(7)
#define BS_B _BV(6)
@uXeBoy
uXeBoy / NESRAM.sch
Created December 27, 2018 03:19
NESRAM.sch
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="8.2.2">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
<setting verticaltext="up"/>
</settings>
<grid distance="0.1" unitdist="inch" unit="inch" style="lines" multiple="1" display="no" altdistance="0.01" altunitdist="inch" altunit="inch"/>
<layers>
@uXeBoy
uXeBoy / minimalDVID_encoder.v
Last active October 9, 2022 03:18
minimalDVID_encoder.v
`default_nettype none // disable implicit definitions by Verilog
//-----------------------------------------------------------------
// minimalDVID_encoder.vhd : A quick and dirty DVI-D implementation
//
// Author: Mike Field <hamster@snap.net.nz>
//
// DVI-D uses TMDS as the 'on the wire' protocol, where each 8-bit
// value is mapped to one or two 10-bit symbols, depending on how
// many 1s or 0s have been sent. This makes it a DC balanced protocol,
// as a correctly implemented stream will have (almost) an equal
@uXeBoy
uXeBoy / Game.cpp
Last active September 13, 2018 12:36
Game.cpp
/*
Copyright (C) 2018 Pharap (@Pharap)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@uXeBoy
uXeBoy / Sine.ino
Created July 17, 2018 01:30
Sine.ino
#include <Wire.h>
#include "Arduboy2.h"
uint8_t AcXH, AcXL;
constexpr float Tau = 6.28318530718;
constexpr float mapRange(float input, float inputMin, float inputMax, float outputMin, float outputMax)
{
return outputMin + (input - inputMin) * ((outputMax - outputMin) / (inputMax - inputMin));
@uXeBoy
uXeBoy / Bit5x5.h
Last active July 12, 2018 13:41
Bit5x5.h
//
// Font data for Bit5x5
// based on http://www.mattlag.com/bitfonts/bit5x5.ttf
//
#include <avr/io.h>
#include <avr/pgmspace.h>
// Character bitmaps for Bit5x5
static const unsigned char font[] PROGMEM =
@uXeBoy
uXeBoy / test-toy.hex
Last active June 3, 2018 12:32
test-toy.hex
:100000000C94E8050C9410060C9410060C94100641
:100010000C9410060C9410060C9410060C94100608
:100020000C9410060C9410060C94510F0C941309A8
:100030000C9410060C9410060C9410060C941006E8
:100040000C9410060C9410060C9410060C941006D8
:100050000C9410060C9410060C9410060C94940B3F
:100060000C9410060C9410060C9410060C941006B8
:100070000C9410060C9410060C9410060C941006A8
:100080000C9410060C9410060C9410060C94100698
:100090000C9410060C9410060C9410060C94100688
@uXeBoy
uXeBoy / JoyStick.ino
Last active May 9, 2018 08:30
JoyStick.ino
/* Read Joystick
* ------------
*
* Reads two analog pins that are supposed to be
* connected to a joystick made of two potentiometers
*
* http://www.0j0.org | http://arduino.berlios.de
* copyleft 2005 DojoDave for DojoCorp
*/
@uXeBoy
uXeBoy / Arduboy2.cpp
Created May 3, 2018 22:45
Arduboy2.cpp
/**
* @file Arduboy2.cpp
* \brief
* The Arduboy2Base and Arduboy2 classes and support objects and definitions.
*/
#include "Arduboy2.h"
#include "ab_logo.c"
#include "glcdfont.c"