Skip to content

Instantly share code, notes, and snippets.

@Trinitek
Trinitek / mikeos_cat_mono.asm
Created April 5, 2014 21:49
Monochrome MikeOS splash screen using 13h mode
;
; MikeOS Cat Splashscreen
; Uses VGA 320x200, 256 color, mode 13h
; Picture data is compressed into one bit per pixel
;
; Blake Burgess // 5 APR 2014
;
width equ 56 ; picture width
height equ 61 ; picture height
C:\PROJECTS\Megaton Dev Kit\Server>java -jar Server.jar
Started server @ port 4000
Authenticates: false
Enabling MMO-Commands plugin
- 1 plugin(s) loaded
Authentication is now on
C:\Users\Blake Burgess\AppData\Roaming/Daexsys/Megaton/images/grass.png
C:\Users\Blake Burgess\AppData\Roaming/Daexsys/Megaton/images/sand.png
C:\Users\Blake Burgess\AppData\Roaming/Daexsys/Megaton/images/dirt.png
@Trinitek
Trinitek / backup.bat
Created October 19, 2014 19:52
Phaeton Minecraft Server - backup.bat
@echo off
set worldName="world3"
:start
echo %0 n [/c] [/w] [/l] [/p]
echo. n - string to append to end of output filename
echo. /c - backup root files
echo. /w - backup world directory
echo. /l - backup log directory
@Trinitek
Trinitek / struct.asm
Created November 9, 2014 06:46
Mode 0x13 tests using FASM's macro functions
; structure test
org 0x100
struc Point x,y {
.x dw x
.y db y
}
public class Main {
public static void main(String args[]) {
System.out.println("Hello world");
return;
}
}
@Trinitek
Trinitek / putchar.c
Last active August 29, 2015 14:12
putChar
void putChar(char c, short x, short y, char color) {
char* glyphOfs = getGlyph(c);
char byte = 0;
char i;
unsigned char pattern = 128u; // 0b10000000
short xOfs = 0;
short yOfs = 0;
for (i = 0; i < 5*5; i++) {
// Plot pixel only if bit is set
@Trinitek
Trinitek / stringExamples.c
Created January 1, 2015 06:30
CRASH COURSE: C POINTERS
// Declaring a new string
char string1[] = "This is a string";
// Declaring an uninitialized array with specified size
char string2[8];
// Declaring an uninitialized array with undefined size
// (SmallerC does not implement this!!)
char string3[];
@Trinitek
Trinitek / lines.c
Last active August 29, 2015 14:12
Line code
void drawLine(short x1, short y1, short x2, short y2, char color) {
short dx = x2 - x1;
short dy = y2 - y1;
short newX = x1;
short newY = y1;
// Iterate along the X axis if slope is not steep (m <= 1)
if (dx >= dy) {
for (; newX <= x2; newX++) {
setPixel(
@Trinitek
Trinitek / lines2.c
Created January 2, 2015 18:12
32-bit line drawing (broken)
asm("mov ax, [bp - 4] \n" // ax = (dy)
"cwde \n"); // sign extend ax to fill eax
asm("mov bx, [bp - 6] \n" // bx = (newX)
"xchg eax, ebx \n" // ax = (newX) <--> bx = (dy)
"cwde \n"); // sign extend ax to fill eax
asm("imul ebx \n"); // eax = (signed)(dy * newX)
asm("mov edx, eax \n" // edx = eax
@Trinitek
Trinitek / lines3.c
Created January 2, 2015 18:13
16-bit line drawing (works!)
asm("mov ax, [bp - 4] \n" // ax = (dy)
"mov bx, [bp - 6] \n"); // bx = (newX)
asm("imul bx \n"); // dx:ax = (dy * newX)
asm("idiv word [bp - 2] \n"); // ax = dx:ax / (dx)
asm("mov [bp - 8] , ax \n"); // (newY) = ax