Skip to content

Instantly share code, notes, and snippets.

View bigfarts's full-sized avatar
💨
toot

bigfarts

💨
toot
View GitHub Profile
import struct
FILENAME = "vol2.dat"
i = 0
max_offset = None
with open(FILENAME, "rb") as f:
f.seek(4 * 2)
while True:
import { useEffect, useMemo, useState, useTransition } from "react";
import {
Navigator, Router, Routes, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext
} from "react-router-dom";
import { Router as RemixRouter, StaticHandlerContext } from "@remix-run/router";
export default function RouterProvider({
router,
staticContext = undefined,
; license: be gay do crime
.gba
.open "bn1.gba", 0x08000000
.org 0x080566e8
bl conditional_flashing
.org 0x080566ec
bl conditional_flinching
diff --git a/wgpu-hal/src/gles/egl.rs b/wgpu-hal/src/gles/egl.rs
index bf11afe8..f2e29b55 100644
--- a/wgpu-hal/src/gles/egl.rs
+++ b/wgpu-hal/src/gles/egl.rs
@@ -854,7 +854,9 @@ impl crate::Instance<super::Api> for Instance {
config: inner.config,
presentable: inner.supports_native_window,
raw_window_handle,
+ present_program: None,
swapchain: None,
use std::borrow::Cow;
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::Window,
};
async fn run(event_loop: EventLoop<()>, window: Window) {
let size = window.inner_size();
let instance = wgpu::Instance::new(wgpu::Backends::PRIMARY);

ROM overview

This is intended to be a quick and dirty overview about how stuff is laid out in memory in BN.

GBA memory map

All I/O on the GBA is done via a big-ass memory map that goes from address 0x00000000 to 0x0fffffff (roughly). For our intents and purposes, we only really need to care about two regions:

  • [0x02000000, 0x04000000): WRAM: This is where the working memory of the GBA is resident. In BN, starting at 0x02000000, this is actually a copy of the save data (SRAM) after it has been decoded.
  • This is further split into EWRAM at [0x02000000, 0x03000000) and IWRAM at [0x03000000, 0x04000000), but we don't have to care too much about this.

Pipsqueak

THIS IS A DRAFT IN REVIEW. DO NOT IMPLEMENT THIS!

  • Version: 0 (DRAFT!)

Pipsqueak is a position-independent patch format. It is designed such that simple ROM formats such as GBA can have multiple patches applied together composably by attaching semantic information to content in the patch such that addresses may be relocated, if required.

Goals:

  • A patch format that supports relocations.
# THIS IS PSEUDOCODE
# THIS IS PSEUDOCODE
# THIS IS PSEUDOCODE
# This is the logic exactly as written in BN6. It's kind of weird!
def processflashing(obj):
if obj.flashingtimeleft == 0 and obj.hit.flash:
obj.flashingtimeleft = 120
obj.hit.flash = False
band = bit.band
function flaginfo_to_string(tbl)
local result = ""
for k, v in pairs(tbl) do
if v then
result = result .. '\n' .. k
end
end
return result:sub(2)
CXX = g++
CXXFLAGS = $(shell pkg-config --cflags ncurses sndfile portaudio-2.0 jsoncpp) -I/opt/homebrew/include -Wall -Wextra -Wconversion -Wunreachable-code -std=c++17 -O3 -g
LDFLAGS = $(shell pkg-config --libs ncurses sndfile portaudio-2.0 jsoncpp) -I/opt/homebrew/lib
BINARY = agbdump
SRC_FILES := $(wildcard agbplay/src/*.cpp)
SRC_FILES := $(filter-out agbplay/src/agbplay.cpp, $(SRC_FILES))
OBJ_FILES = $(addprefix agbplay/obj/,$(notdir $(SRC_FILES:.cpp=.o)))