Skip to content

Instantly share code, notes, and snippets.

View IridescentRose's full-sized avatar
🙃
Currently writing Minecraft for the PSP

Nathan Bourgeois IridescentRose

🙃
Currently writing Minecraft for the PSP
View GitHub Profile
@IridescentRose
IridescentRose / elf.zig
Created April 9, 2024 16:44
Parse an ELF file in Zig
const std = @import("std");
pub const ELF_MAGIC = [_]u8{ 0x7F, 0x45, 0x4C, 0x46 };
pub const ElfClass = enum(u8) {
Elf32 = 1,
Elf64 = 2,
};
pub const ElfData = enum(u8) {
@IridescentRose
IridescentRose / uuid.zig
Last active December 1, 2021 13:52
A simple UUID v4 Generator
const std = @import("std");
const chars : []const u8 = "0123456789ABCDEF";
pub const UUID = struct{
const Self = @This();
id: [36]u8,
pub fn new(seed: u64) !*Self{
var r = std.rand.DefaultPrng.init(seed);
@IridescentRose
IridescentRose / gfx.zig
Created October 5, 2020 23:37
Pixel Rendering in Zig
usingnamespace @import("../Zig-PSP/src/psp/include/pspge.zig");
usingnamespace @import("../Zig-PSP/src/psp/include/psputils.zig");
usingnamespace @import("../Zig-PSP/src/psp/utils/psp.zig");
usingnamespace @import("../Zig-PSP/src/psp/include/pspdisplay.zig");
var draw_buffer: ?[*]u32 = null;
var disp_buffer: ?[*]u32 = null;
pub fn init() void{
draw_buffer = @intToPtr(?[*]u32, @ptrToInt(sceGeEdramGetAddr()));
@IridescentRose
IridescentRose / installer.nsi
Created January 23, 2020 08:12
MC PSP Installer script
!include "ZipDLL.nsh"
Name "Minecraft PSP Installer"
OutFile "Minecraft-PSP.exe"
DirText "This installer will rip Minecraft Assets and create a launcher folder at the specified location."
InstallDir $Desktop
Section ""