Skip to content

Instantly share code, notes, and snippets.

View F0bes's full-sized avatar
👀
Looking for some work :)

Ty F0bes

👀
Looking for some work :)
  • Ontario, Canada
  • 13:39 (UTC -04:00)
View GitHub Profile
@F0bes
F0bes / gist:707b711b7d081a6171d9ccc466a9a42d
Last active December 16, 2023 22:24
imhex for gs dumps.
#include <std/mem.pat>
using GSDumpHeader_New;
using GSRegisterCommand;
using GSVsyncCommand;
using GSTransferCommand;
using GSReadFIFOCommand;
using FreezeData;
enum DumpTag : u8
@F0bes
F0bes / sprremap.c
Created November 23, 2023 20:03
Scratchpad TLB Entry Remap
#include <tamtypes.h>
#include <kernel.h>
#include <stdio.h>
#include <ee_regs.h>
// Required due to an issue with ps2links reset
void _libcglue_timezone_update(void) {}
int main()
{
@F0bes
F0bes / ct32_to_ct16.py
Created November 11, 2023 20:16
PS2 TEX TOOLS
import sys
val = int(sys.argv[1], 16)
r = val & 0xff
r = r >> 3
g = (val >> 8) & 0xff
g = g >> 3
b = (val >> 16) & 0xff
b = b >> 3
ct16 = (b << 10) | (g << 5) | (r) | (((val >> 24) & 1) << 15)
#include <stdio.h>
#include <stdlib.h>
#include <graph.h>
#include <dma.h>
#include <gs_psm.h>
#include <gs_gp.h>
#include <draw.h>
#include <kernel.h>
#include "memmap.h"
#include <kernel.h>
#include <stdio.h>
#include <graph.h>
#define INTC_STAT (*(volatile u32 *)0x1000F000)
#define GSCSR (*(volatile u64 *)0x12001000)
#define SYNCV (*(volatile u64 *)0x12000060)
#define SMODE1 (*(volatile u64 *)0x12000010)
static inline void wait_intc_vsync()
// Provides a testing suite for sub pixel offsets with UV mapping
#include <kernel.h>
#include <stdio.h>
#include <draw.h>
#include <graph.h>
#include <gs_psm.h>
#include <gif_registers.h>
#include <gs_gp.h>
#include <gs_privileged.h>
#include <gif_tags.h>
{
q = packet->data;
PACK_GIFTAG(q, GIF_SET_TAG(2, 1, GIF_PRE_ENABLE, GS_SET_PRIM(GS_PRIM_SPRITE, 0, 1, 0, 0, 0, 1, 0, 0), GIF_FLG_PACKED, 6),
GIF_REG_AD | (GIF_REG_AD << 4) | (GIF_REG_UV << 8) | (GIF_REG_XYZ2 << 12) | (GIF_REG_UV << 16) | (GIF_REG_XYZ2 << 20));
q++;
{
// TEX0
q->dw[0] = GS_SET_TEX0(fb.address / 64, 1, GS_PSM_32, 7, 7, 0, 1, 0, 0, 0, 0, 0);
q->dw[1] = GS_REG_TEX0;
q++;
F -> 0
S -> 3394607356
I -> 172
F -> 0
S -> 3395086456
I -> 172
F -> 0
S -> 3395550764
I -> 172
F -> 0
#include <kernel.h>
#include <stdio.h>
#include <graph.h>
#include <draw.h>
#define GSCSR (*(volatile u64 *)0x12001000)
static u32 value = 0;
static s32 sema_vblanks_id = 0;
@F0bes
F0bes / prog_field.c
Created May 29, 2022 01:40
Test if FIELD changes when the video mode is set to progressive
#include <kernel.h>
#include <stdio.h>
#include <graph.h>
#include <draw.h>
#include <gs_psm.h>
#define INTC_STAT (*(volatile u32 *)0x1000F000)
#define GSCSR (*(volatile u64 *)0x12001000)
int main(void)