Skip to content

Instantly share code, notes, and snippets.

View sajattack's full-sized avatar

Paul Sajna sajattack

View GitHub Profile
@sajattack
sajattack / fpu.txt
Created October 23, 2020 05:54
sceFpu library for Sony PSP mips floating point unit
0x00015a2c <sceFpuGetFCR31+0>: cfc1 v0,$31
0x00015a30 <sceFpuGetFCR31+4>: jr ra
0x00015a34 <sceFpuGetFCR31+8>: nop
0x00015a38 <sceFpuSetFCR31+0>: cfc1 v0,$31
0x00015a3c <sceFpuSetFCR31+4>: ctc1 zero,$31
0x00015a40 <sceFpuSetFCR31+8>: nop
0x00015a44 <sceFpuSetFCR31+12>: ctc1 a0,$31
0x00015a48 <sceFpuSetFCR31+16>: jr ra
0x00015a4c <sceFpuSetFCR31+20>: nop
0x00015a50 <sceFpuAbs+0>: jr ra
@sajattack
sajattack / vfpu.txt
Created October 23, 2020 05:29
sceVfpu, Sony's static library for the PSP's hardware vector unit
sceVfpuVector2SignFloat:
lwc1 f0,0x0(a1)
mtc1 zero,f1
c.lt f0,f1
nop
bc1f pos_0881A344
lui v1,0x88E
lwc1 f0,-0x4560(v1)
found match: 844AF6BD = sceSysregDeleteReincarnatedDevctl
found match: 584AD989 = sceSysregMp3HandleTranslationSendmsg
found match: 136E8F5A = sceSysregPositionAA3HalfwayCompressed
found match: 55B18B84 = sceSysregYDmaCreate
found match: 136E8F5A = sceSysregAAttachEVOLNetconf
found match: 136E8F5A = sceSysregAGlobalDescSHA1
found match: 7BDF0556 = sceSysregATicksHJoin
found match: 2112E686 = sceSysregAA3DataCallbacksNMt19937
found match: 0EA487FA = sceSysregAA3DataChPkgDetect
found match: 7B9E9A53 = sceSysregAA3DataRotatePrependJoin
@sajattack
sajattack / nid-collisions.txt
Created October 7, 2020 09:03
NID collisions
found match: 2458B6AC = sceSysregAddressSwitchGPO
found match: 1561BCD2 = sceSysregAsHandlersFormatted
found match: C9585F8E = sceSysregBindReferAccept
found match: 20B1D0A9 = sceSysregGetSkipDigest
found match: C6C75585 = sceSysregGetsockoptParamUMD
found match: B6296512 = sceSysregMkdirReplaceReincarnated
found match: 85B74FDA = sceSysregPutcharPrngenWait
found match: 15786501 = sceSysregSha1BatteryInfo
#![no_std]
#![no_main]
extern crate metro_m4 as hal;
extern crate cortex_m;
extern crate panic_halt;
extern crate usb_device;
extern crate usbd_serial;
use hal::clock::GenericClockController;
fn draw_iter<T>(&mut self, pixels: T) -> Result<(), Self::Error>
where T: IntoIterator<Item = Pixel<Rgb888>> {
let mut ptr = self.vram_base as *mut u32;
let mut iter = pixels.into_iter();
let Pixel(coord, _color) = iter.next().unwrap();
unsafe {
if let Ok((x @ 0..=SCREEN_WIDTH, y @ 0..=SCREEN_HEIGHT)) = coord.try_into() {
ptr = (self.vram_base as *mut u32)
.offset(x as isize)
.offset((y * BUF_WIDTH) as isize);
@sajattack
sajattack / bindings.rs
Created May 11, 2020 17:38
PSPSDK Rust Bindings
/* automatically generated by rust-bindgen */
pub const _PSPTYPES_H_: u32 = 1;
pub const __have_longlong64: u32 = 1;
pub const __have_long64: u32 = 1;
pub const __int8_t_defined: u32 = 1;
pub const __int_least8_t_defined: u32 = 1;
pub const __int16_t_defined: u32 = 1;
pub const __int_least16_t_defined: u32 = 1;
pub const __int32_t_defined: u32 = 1;
@sajattack
sajattack / neopixel_rainbow.rs
Created March 10, 2019 22:11
neopixel rainbow using timers on trellis_m4
#![no_std]
#![no_main]
extern crate cortex_m;
extern crate panic_halt;
extern crate smart_leds;
extern crate trellis_m4 as hal;
extern crate ws2812_timer_delay as ws2812;
use hal::prelude::*;
@sajattack
sajattack / sid.rs
Last active March 5, 2019 17:40
siddacious' requested demo
#![no_std]
#![no_main]
extern crate cortex_m;
extern crate trellis_m4 as hal;
extern crate panic_halt;
extern crate smart_leds;
extern crate smart_leds_trait;
extern crate ws2812_timer_delay as ws2812;
extern crate embedded_hal;
@sajattack
sajattack / fail.txt
Created February 28, 2019 01:20
#define hell
[paul@P50-Arch python]$ rg "define SIZEOF_LONG" build
build/pyconfig.h
1360:#define SIZEOF_LONG 8
1363:#define SIZEOF_LONG_DOUBLE 16
1366:#define SIZEOF_LONG_LONG 8
build/configure
8567:#define SIZEOF_LONG $ac_cv_sizeof_long
8600:#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
8924:#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double