Skip to content

Instantly share code, notes, and snippets.

View barbeque's full-sized avatar

Mike barbeque

  • Calgary AB Canada
View GitHub Profile
@barbeque
barbeque / p6tech-11-english.md
Created March 28, 2024 22:04
PC-6001 P6Tech #11 - CMT decoding - English translation

Original article at http://p6ers.net/mm/pc-6001/cas/p6tech_11.pdf (thank you)

Basic control of CMT is performed by the SUB CPU. From the Z80 side, through the SUB CPU You can only write 1Byte to tape or read 1Byte from tape. Z80 is first First, tell the SUB CPU whether the operation you are about to perform is to start writing a tape or You need to tell it whether to start reading the file or not. The way to convey this is to use the Z80 explained in the previous chapter. By sending 1 byte or 2 bytes of data consecutively, The SUB CPU goes into CMT control mode.

| command code | processing content |

@barbeque
barbeque / gist:44a00a1bbaa02509b961
Created March 12, 2015 20:24
Defining custom object and passing it into powershell functions
function NewSteak() {
$steak = New-Object PSObject
$steak | Add-Member -type NoteProperty -Name Doneness -Value "Rare"
$steak | Add-Member -type NoteProperty -Name Juiciness -Value "Low"
return $steak
}
function AuditSteak([PSObject]$steak) {
@barbeque
barbeque / withblock.py
Created March 21, 2020 03:35
how to implement behaviour of 'with' blocks in python
class Exiter():
def __enter__(self):
print('i am in a block')
return self # critical
def __exit__(self, type, value, tb):
print('goodbye cruel world')
def add(self, a, b):
return a + b
with Exiter() as exiter:
@barbeque
barbeque / D88STRUC.txt
Created November 18, 2018 16:45
d88 file structure
D88 (D68/D77/D98) File Structure
JPN Translations (http://jpntrans.nobody.jp)
--------------------------------------------------
People Involved
--------------------------------------------------
Translation, editing, etc.: Tokugawa Corporate Forum's Ashura
Hosting: noname345
--------------------------------------------------
@barbeque
barbeque / gist:38127addfc43d1eab028d4a4ac3fbcd4
Created November 6, 2018 21:18
m88 linker errors - not too many right?
SuperMactendo:M88p2 mike$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o src/pc88/base src/pc88/base.o src/pc88/beep.o src/pc88/calender.o src/pc88/crtc.o src/pc88/diskmgr.o src/pc88/fdc.o src/pc88/fdu.o src/pc88/floppy.o src/pc88/intc.o src/pc88/ioview.o src/pc88/joypad.o src/pc88/kanjirom.o src/pc88/memory.o src/pc88/memview.o src/pc88/mouse.o src/pc88/opnif.o src/pc88/pc88.o src/pc88/pd8257.o src/pc88/pio.o src/pc88/screen.o src/pc88/sio.o src/pc88/sound.o src/pc88/subsys.o src/pc88/tapemgr.o
Undefined symbols for architecture x86_64:
"DeviceList::Add(IDevice*)", referenced from:
PC88::ConnectDevices() in pc88.o
"DeviceList::Find(unsigned int)", referenced from:
PC88::IsCDSupported() in pc88.o
@barbeque
barbeque / p88sr.doc
Created October 20, 2018 19:08
partially translated p88sr readme
-------------------------
P88SR.EXE マニュアル
-------------------------
【概要】
PC8801mk-2SR( V2 MODE ,8 MHz ) の機能をエミュレートします。
int main(void) {
WindowPtr TheWindow;
InitGraf(&thePort);
InitFonts();
InitWindows();
TheWindow = GetNewWindow(128, 0L, (WindowPtr)-1L);
SetPort(TheWindow);
MoveTo(30, 50);
DrawString("\pHello, World");
@barbeque
barbeque / hashtable.rkt
Created July 6, 2017 21:08
Racket Hashtable cheat sheet
> (define myhash #hasheq((name . "bob")))
> (hash-has-key? myhash `name)
#t
> (hash-ref myhash `name)
"bob"
/* Expected exposure is the expected (average) credit exposure conditional on positive market values */
def expectedExposure(marketValues: Seq[Double]): Double = {
val exposures = marketValues.filter(_ > 0f)
if (exposures.size == 0) 0.0
else exposures.sum / exposures.size
}
/* A high percentile (95%) of the distribution of exposures at any particular future date. Also called Peak Exposure (PE) */
def potentialFutureExposure(marketValues: Seq[Double], confidenceLevel: Double): Double = {
val exposures = marketValues.filter(_ > 0)
@barbeque
barbeque / gist:4040723
Created November 8, 2012 18:50
Turning C# generic Type back into "C# Type" declaration style.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Reflection;
namespace GenericCodeGenerator
{
class Program