Skip to content

Instantly share code, notes, and snippets.

View gucchan22's full-sized avatar

GUCCHAN gucchan22

  • Japan
View GitHub Profile
@gucchan22
gucchan22 / font_analyzing.pde
Last active August 29, 2015 14:02
画像処理 中間発表課題
import processing.net.*;
import java.util.*;
Client voice_client;
PImage target_img, edge_img;
PFont font;
void setup() {
voice_client = new Client(this, "127.0.0.1", 10500);
target_img = loadImage("sample.jpg");
@gucchan22
gucchan22 / consistent_hashing.rb
Last active August 29, 2015 14:02
Consistent HashingのRuby実装
#-*-coding:utf-8 -*-
require "diegst/sha1"
require "radix"
class ConsitentHashing
def initialize(n = Integer, nodes)
@virtual_num = n
@ring = {}
@keys = []
@nodes = []
#include <string.h>
#include <stdint.h>
#include <iostream>
#include <fstream>
#include "SDL.h"
class RAM;
class CPU;
class PPU;
http://www.maroon.dti.ne.jp/koten-kairo/works/hard/crtc1/display_genri.html
https://code.google.com/p/webrtc/issues/detail?id=383
#include <iostream>
#include <string>
#include <stdio.h>
#include <stdint.h>
#include <SDL2/SDL.h>
#define __DEBUG_FLAG__ 1
class INESParser {
const char *rom_path;
uint8_t *prg_rom = NULL;
@gucchan22
gucchan22 / p.rb
Last active August 29, 2015 14:09
diff -ur litenes/src/fce/cpu.c litenes2/src/fce/cpu.c
--- litenes/src/fce/cpu.c 2014-11-17 23:59:46.283859234 +0900
+++ litenes2/src/fce/cpu.c 2014-11-18 00:01:49.787853728 +0900
@@ -46,7 +46,7 @@
#define cpu_update_zn_flags(value) cpu.P = (cpu.P & ~(zero_flag | negative_flag)) | cpu_zn_flag_table[value]
-#define cpu_branch(flag) if (flag) cpu.PC = op_address;
+#define cpu_branch(flag) if (flag) cpu.PC = op_address; op_cycles += 1;
#define cpu_compare(reg) int result = reg - op_value; \
function generateCounter2(a)
{
var b=String(a).split("");
if(b.length>=4)
{
b.splice(b.length-3,0,',')
}
if(b.length>=8)
{
b.splice(b.length-7,0,',')
#-*- coding:utf-8 -*-
require "net/http"
require "json"
require "nokogiri"
class ODA
ODA_hdr = {
"Host" => "www2.onlinedisassembler.com",
"Content-Type" => "application/x-www-form-urlencoded; charset=UTF-8",
"Referer" => "http://www2.onlinedisassembler.com/odaweb/",
table = {
"aarch64" => "ARM Architecture 64bit State",
"alpha" => "DEC Alpha(Alpha AXP), alpha:ev(4~6)=Alpha (4~6)",
"arc" => "Synopsys DesignWare ARC Processor, arc:(5~8)=ARC (5~8)"
"arm" => "ARM armv(2~5)=ARMv(2~5), v2a, v3m, v4t, v5t, v5te",
"xscale" => "Intel XScale (ARM Architecture)",
"ep9312" => "ARM (ARM 920T based)",
"iwmmxt" => "Intel Wireless MMX Technology(iWMMXt) iwmmxt2=iWMMXt 2",
"avr" => "Atmel AVR avr:(1,2,25,3,31,35,4,5,51,6,101,102,103,104,105,106,107)=AVR (1..107)",
"bfin" => "Blackfin Processor",
struct OAMData { int y, x, tile, flags; };
void render_line(int line) {
int x,c = 0;
struct OAMData oam_per_line[10];
unsigned int *screen_buff = sdl_get_framebuffer();
for(int i = 0; i < 40; i++) { // 40 * 4byte = 160byte (0xfe00 ~ )
int y = mem_get_raw(0xfe00 + (i * 4)) - 16;
if(line < y || line >= y + 8 + (sprite_size * 8)) continue;
oam_per_line[i].y = y;
oam_per_line[i].x = mem_get_raw(0xfe00 + (i * 4) + 1) - 8;