This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; note, I really don't care if you don't include the licence text, | |
; just use this damn thing and save yourself some pain --@fanzyflani | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; | |
; icomboot | |
; Copyright (c) 2014, fanzyflani | |
; | |
; Permission is hereby granted, free of charge, to any person obtaining a copy | |
; of this software and associated documentation files (the "Software"), to deal | |
; in the Software without restriction, including without limitation the rights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static uint32_t color_sse_to_bytes_1(__m128 m) | |
{ | |
// Introducing a new, novel way of documenting code! | |
__m128 multiply_by_255 = _mm_mul_ps(m, _mm_set1_ps(255.0f)); | |
__m128i then_convert_to_int = _mm_cvtps_epi32(multiply_by_255); | |
__m128i pack_once = _mm_packs_epi32(then_convert_to_int, then_convert_to_int); | |
__m128i pack_again = _mm_packus_epi16(pack_once, pack_once); | |
int get_the_int_and_return = _mm_cvtsi128_si32(pack_again); | |
return get_the_int_and_return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float box_crosses(const box_t *box, const v4f_t *p, const v4f_t *vi, int *inside, int *side) | |
{ | |
// the general idea: | |
// define the "out" faces to be in the direction of the ray velocity. | |
// define the "in" faces to be the other faces. | |
// if the largest "in" face distance is smaller than the smallest "out" face distance, | |
// return the largest "in" face distance - we've hit the box. | |
// otherwise, return -1.0f. | |
// copy vi so we don't mutilate it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; | |
;;; Jump table vector | |
;;; | |
.orga $0050 | |
.section "int_timer" force | |
jp irq_tima | |
.ends | |
;;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_scim_update_copy: | |
push af | |
push bc | |
push hl | |
; Load pointers | |
ld a, (scim_src_ptr+0) | |
ld l, a | |
ld a, (scim_src_ptr+1) | |
ld h, a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, struct | |
START = 0x002C | |
DPERIOD = 1000 | |
def dither(y, x): | |
x %= DPERIOD | |
if x >= DPERIOD//2: | |
x = DPERIOD - x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <errno.h> | |
#include <math.h> | |
#include <GL/glew.h> | |
#include <SDL.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0000: MOV r4, #0x80000000 | |
0004: MOV r1, #0x00000040 | |
0008: LDRB r2, [r1], #1 | |
000C: CMP r2, #0xFF | |
0010: BEQ 0x00000034 | |
0014: LDRB r0, [r4] | |
0018: CMP r0, #0xFF | |
001C: BEQ 0x00000014 | |
0020: CMP r0, r2 | |
0024: BEQ 0x00000004 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0000: MOV r1, #0x00000020 | |
0004: LDRB r2, [r1], #1 | |
0008: CMP r2, #0xFF | |
000C: BEQ unlock_door_and_halt | |
0010: BL wait_for_key | |
0014: CMP r0, r2 | |
0018: BNE sound_alarm_and_halt | |
001C: B 0x00000004 | |
0020: DB 0x03, 0x01, 0x04, 0x01, 0xFF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code_beg: | |
ldr r3, =0xEDB88320 | |
mvn r0, #0x00000000 | |
mov r1, #0x00000000 | |
mov r4, #(code_end - code_beg)>>2 | |
lp_crc_words: | |
ldr r2, [r1], #4 | |
eor r0, r0, r2 | |
mov r5, #32 | |
lp_crc_bits: |