Skip to content

Instantly share code, notes, and snippets.

View NichtJens's full-sized avatar
🎩
/\/\/\/\/\/\/\/\/\

Auf keinen Fall Jens NichtJens

🎩
/\/\/\/\/\/\/\/\/\
View GitHub Profile
@NichtJens
NichtJens / Makefile.cargo
Last active March 24, 2019 15:39 — forked from mzabaluev/Makefile.cargo
Drop-in makefile for Cargo projects
CARGO = cargo
all: build doc
build:
@$(CARGO) build
doc:
@$(CARGO) doc
@NichtJens
NichtJens / PhpJava.java
Created September 1, 2016 04:23 — forked from avafloww/PhpJava.java
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@NichtJens
NichtJens / ap8diff.sh
Created June 25, 2015 12:51
Create a temporary autopep8'ed version of a Python script and diff(meld/diffuse) it with the original
#!/bin/bash
set -o nounset
set -o errexit
if [ "$#" == "0" ]; then
echo "usage: $0 [autopep8 options] input.py"
exit 1
fi
#!/usr/bin/python
# http://kennastuff.blogspot.de/2013/03/zelda-starring-zelda-python-code.html
# You'll need to have a copy of Legend of Zelda named "original.nes"
# in the same folder as the .py file. Run the .py file
# and it'll spit out a file called "hack.nes".
ORIGINAL_SCROLL_TEXT = [
diff --git a/modules/eb/EbModule.py b/modules/eb/EbModule.py
index fd99ecb..8759639 100644
--- a/modules/eb/EbModule.py
+++ b/modules/eb/EbModule.py
@@ -7,7 +7,21 @@ try:
from modules.eb import NativeComp
hasNativeComp = True
except ImportError:
- hasNativeComp = False
+ try:
diff --git a/modules/eb/BattleBgModule.py b/modules/eb/BattleBgModule.py
index f771fb9..0667f3c 100644
--- a/modules/eb/BattleBgModule.py
+++ b/modules/eb/BattleBgModule.py
@@ -55,12 +55,12 @@ class BattleBgModule(EbModule.EbModule):
if (self._bbgGfxArrs[gfxNum] == None):
# Max size used in rom: 421 (2bpp) 442 (4bpp)
tg = EbTileGraphics(512, 8, colorDepth)
- with EbCompressedData() as tgb:
+ with EbCompressedData(tg.sizeBlock()) as tgb:
CC = gcc
CFLAGS = -fPIC -O3 -shared
LDFLAGS =
SOURCES = NativeComp.c
OBJECTS = $(SOURCES:.c=.so)
CFLAGS += `pkg-config --cflags python`
LDFLAGS += `pkg-config --libs python`