Skip to content

Instantly share code, notes, and snippets.

View tschak909's full-sized avatar
🏠
Working from home

Thomas Cherryhomes tschak909

🏠
Working from home
View GitHub Profile
@tschak909
tschak909 / fast_text.s
Created October 18, 2018 21:54
Atari 8-bit fast text output routine for PLATOTerm
; Render Glyph
; Args:
; cx, cy (coordinates)
; CharCode (character)
; GlyphData (address of glyph data)
; Flags: bit 7: 1 = reverse video, 0 = normal
; bit 6: 1 = double size, 0 = normal
; bit 5: 1 = transparent background mode, 0 = normal
; bit 4: 1 = render in background colour with transparent background
;
@tschak909
tschak909 / ptamiga.c
Created November 12, 2018 05:24
PLATOTerm Amiga serial send io and keyboard routines.
/**
* keyboard_main - Handle the keyboard presses
*/
void keyboard_main(void)
{
while (intuition_msg = (struct IntuiMessage *) GetMsg(myWindow->UserPort))
{
if (intuition_msg->Class == VANILLAKEY)
{
io_send_byte(intuition_msg->Code);
@tschak909
tschak909 / screen_char_draw_amiga.c
Created November 20, 2018 21:49
Character draw routines for Amiga using per-pixel calls.
/**
* screen_char_draw(Coord, ch, count) - Output buffer from ch* of length count as PLATO characters
*/
void screen_char_draw(padPt* Coord, unsigned char* ch, unsigned char count)
{
short offset; /* due to negative offsets */
unsigned short x; /* Current X and Y coordinates */
unsigned short y;
unsigned short* px; /* Pointers to X and Y coordinates used for actual plotting */
@tschak909
tschak909 / slowdown.erl
Created November 23, 2018 18:31
A throttling server for systems that can't handshake. Handles many connections.
-module(slowdown).
-export([run/0]).
-define(PORT_FROM, 5005).
-define(PORT_TO, 8005).
-define(BACKLOG, 10000).
run() ->
@tschak909
tschak909 / coco_splash.h
Created November 28, 2018 18:15
Tandy Coco splash for PLATOTerm
0x1b,
0x02,
0X1B,
0X0C,
0X1B,
0X12,
0X1B,
0XD1,
0XC0,
0X50,
@tschak909
tschak909 / zx_tiny_term.c
Created December 1, 2018 16:56
The tiniest term possible using the rs232 api.
#include <conio.h>
#include <stdio.h>
#include <spectrum.h>
#include <rs232.h>
void main(void)
{
unsigned char inb,ch;
rs232_params(RS_BAUD_9600|RS_STOP_1|RS_BITS_8,RS_PAR_NONE); // Bauds tested 1200[/] 2400[/] 4800[/] 9600[/] 19200[X] 38400[X] 57600[] 115200[]
rs232_init();
@tschak909
tschak909 / clipboard.c
Created December 25, 2018 04:19
clipboard dump rastport bitmap.
/**
* Write 4 bytes to clipboard device. Used for headers
*/
void clipboard_write_long(long* data)
{
clip_ior->io_Data=(STRPTR)data;
clip_ior->io_Length=4;
clip_ior->io_Command=CMD_WRITE;
DoIO((struct IORequest *)clip_ior);
}
@tschak909
tschak909 / clipboard.c
Created December 26, 2018 21:21
Amiga: Simple example to copy a rastport to the clipboard.device.
/**
* Write 4 bytes to clipboard device. Used for headers
*/
void clipboard_write_long(long* data)
{
clip_ior->io_Data=(STRPTR)data;
clip_ior->io_Length=4;
clip_ior->io_Command=CMD_WRITE;
DoIO((struct IORequest *)clip_ior);
}
@tschak909
tschak909 / terminal_char_load_test_harness.c
Created January 10, 2019 15:34
terminal_char_load test harness for 5x6 character loading.
#include <stdio.h>
// Pulled in typedef from protocol.h
typedef short padWord;
typedef padWord charData[8];
const unsigned short word_data[] =
{
/* 0177777,0160017,0170017,0174177,0176077,0160037,0160017,0177777 */ // N
/* 0177777,0160017,0160017,0163717,0163717,0163717,0163717,0177777 // C */
@tschak909
tschak909 / terminal_char_load.c
Created January 12, 2019 03:32
Working terminal_char_loaded for 5x6 pixel wide fonts
/**
* PLATOTerm64 - A PLATO Terminal for the Commodore 64
* Based on Steve Peltz's PAD
*
* Author: Thomas Cherryhomes <thom.cherryhomes at gmail dot com>
*
* terminal_char_load.c - Character set loading routine for 5x6 font.
*/
#include <string.h>