Skip to content

Instantly share code, notes, and snippets.

@kcbanner
kcbanner / zig-compilation-regexp.elisp
Last active March 27, 2023 03:30
Regex for zig compiler output (parallel compatible)
(add-to-list
'compilation-error-regexp-alist-alist
'(zig
"^\\(\\(.*\\):\\([0-9]+\\):\\([0-9]+\\)\\): \\(note:.*\\)?\\(error:.*\\)?$"
2
3
4
(nil . 5)
1
(5 compilation-info-face)
;; 4 space tabs
(defun my-generate-tab-stops (&optional width max)
"Return a sequence suitable for `tab-stop-list'."
(let* ((max-column (or max 200))
(tab-width (or width tab-width))
(count (/ max-column tab-width)))
(number-sequence tab-width (* tab-width count) tab-width)))
(setq default-tab-width 4)
# All numeric values are in hexadecimal
# Use TAB or EQUAL sign to separate name from value
#
# Key configuration (all numbers are in hexadecimal!)
#
# Keys values are in the format YYYYXXXX where YYYY is the device number.
# 0 means keyboard and XXXX is the SDL define for the desired key
# (read SDL_keysym.h).
#
Binutils:
mkdir binutils-objdir
cd binutils-objdir
CFLAGS="-Wno-error=deprecated-declarations -Wno-error=unused-variable -Wno-error=unused-function" ../binutils-2.24/configure --target=arm-agb-elf --program-prefix=arm-agb-elf-
make
make install
Installing GCC:
#include <stdint.h>
uint16_t *fb = (void*)0x6000000;
const int xsz = 240;
const int ysz = 160;
#define FRAME_SEL_BIT 0x10
#define BG2_ENABLE 0x400
int main(void) {
#version 150
#define BLUR_Y 0.004
uniform sampler2D diffuseTexture;
uniform sampler2D lightsTexture;
uniform float time;
uniform vec2 resolution;
uniform float distortion;
void GLRenderManager::render() {
GLSpriteBatch* batch;
std::list<GLSpriteBatch*>::iterator i;
// Sort batches by layer and upload to GPU
mActiveBatches.sort(sortByLayer());
for (i = mActiveBatches.begin(); i != mActiveBatches.end(); ++i) {
batch = *i;
void AttackComponent::onEntityCollisionEvent(IEventPtr pEvent) {
std::shared_ptr<EntityCollisionEvent> pCastEvent = std::static_pointer_cast<EntityCollisionEvent>(pEvent);
// Don't care if we collide with our selves
const RigidBody* aRigidBody = pCastEvent->getRigidBodyA();
if (aRigidBody->name == PROJECTILE_RIGID_BODY_NAME && aRigidBody->parent == mParent) {
// Play the hit animation
DroneComponent = class(nil, {});
function DroneComponent:OnInit(parentComponent)
self.uptime = 0;
self.parentComponent = parentComponent;
entity = self.parentComponent:getParent();
self.position = _G['caracal::ScriptUtil']:getPositionComponent(entity):getPosition();
self.lightComponent = _G['caracal::ScriptUtil']:getLightComponent(entity);
ExplosionComponent = class(nil, {});
function ExplosionComponent:OnInit(parentComponent)
self.uptime = 0;
self.parentComponent = parentComponent;
self.lightComponent = self.parentComponent:getLightComponent();
end
function ExplosionComponent:OnPreUpdate(dt)
self.uptime = self.uptime + dt;