Skip to content

Instantly share code, notes, and snippets.

@masterzorag
masterzorag / argb_vector.c
Created November 13, 2017 18:26
An example of using Clang vector extension
/*
an example of using GCC/Clang vector extension
clang argb_vector.c
./a.out
0 ffffffff ffffffff
1 dde0e2e5 dddfe1e4
2 bbc0c5ca bbbfc4c9
3 99a1a8af 99a0a7ae
[ORBIS][INFO]: sceKernelGetModuleList = 0
[ORBIS][INFO]: SceKernelModule[18] = {
[ORBIS][INFO]: 00, 200102, 0E, 10, 11, 12, 22, 31, 203233, 3F, 40, 41, 42, 43, 47, 48, 
[ORBIS][INFO]: }
[ORBIS][INFO]: sceKernelGetModuleInfo(00) = 0
[ORBIS][INFO]: struct SceKernelModuleInfo
[ORBIS][INFO]: {
[ORBIS][INFO]: 	name: homebrew.self
[ORBIS][INFO]: 		segment[0].address: 400000
@masterzorag
masterzorag / samplenfs_dr_mp3.md
Created April 3, 2020 18:07
samplenfs_dr_mp3 full debug output

new sample samplenfs_dr_mp3 uses updated liborbisAudio

thinstar ~ # nc -ul -p 18194
[PS4][INFO]: debugnet initialized
[PS4][INFO]: ready to have a lot of fun...
[PS4][DEBUG]: [ORBISLINK] initOrbisLinkApp before get nfsurl from config.ini
[PS4][DEBUG]: [ORBISLINK] initOrbisLinkApp nfsurl nfs://10.0.0.2/hostapp
[PS4][DEBUG]: [ORBISNFS] orbisNfsInit
[PS4][DEBUG]: [ORBISNFS] orbisNfsCreateConf
[PS4][DEBUG]: [ORBISNFS] orbisNfsInit calling nfs_init_context
log: [PS4][DEBUG]: R2 pressed
log: [PS4][DEBUG]: uid: 0, gid: 0
log: [PS4][DEBUG]: [PS4LINK] UID: 0, GID: 0
log: [PS4][DEBUG]: [PS4LINK] /dev
log: [PS4][DEBUG]: directory 15
log: [PS4][DEBUG]: fstat  return  0x00000000 st.st_blksize=16384
log: [PS4][DEBUG]: buffer not null
log: [PS4][DEBUG]: before getdent
log: [PS4][DEBUG]: after getdent 3548
@masterzorag
masterzorag / affine.c
Last active July 21, 2019 12:09
compute affine transform
/* clang affine.c -Wextra */
/*
./a.out 1
1.000000 in [-1 1] = 255 in [0 255]
./a.out 0
0.000000 in [-1 1] = 127 in [0 255]
./a.out -1
-1.000000 in [-1 1] = 0 in [0 255]
*/
@masterzorag
masterzorag / mpz_squares.c
Created April 9, 2019 20:32
gmp sample to compute square roots
#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>
int main(int argc, char *argv[])
{
mpz_t x, t, prev, dif;
mpz_init(dif);
mpz_init(t);
mpz_init(prev);
  • No video output, use ssh
# ssh 10.0.0.24 -p 2020

Welcome to better-initramfs master-d0acfbe-2017-03-04. Linux kernel 4.14.74.

>>> The lockfile was created.
>>> In order to resume boot proces, run 'resume-boot'.
>>> Be aware that it will kill your connection which means
@masterzorag
masterzorag / note_install.md
Last active November 8, 2018 22:36
notes about bootstrapping a Fedora 29 base install

Fedora 29 base install note

0. preamble to test on ps4

  • wired (NOT wireless) ps4 connection to net
  • those files, pinned in #ps4-linux Discord
0000000000401e30 <_Z17star_accell1_4sseR6t_star>:
401e30: 55 push %rbp
401e31: 48 89 e5 mov %rsp,%rbp
401e34: 53 push %rbx
401e35: 48 81 ec e8 00 00 00 sub $0xe8,%rsp
401e3c: 48 89 fb mov %rdi,%rbx
401e3f: e8 dc ee ff ff callq 400d20 <mcount@plt>
401e44: 0f 57 db xorps %xmm3,%xmm3
401e47: 0f 29 5d e0 movaps %xmm3,-0x20(%rbp)
401e4b: 0f 29 5d d0 movaps %xmm3,-0x30(%rbp)
cl_get_gt_device(): error, unknown device: 0                                                                                               

  Platform Name                                   Clover                                                                                   
Number of devices                                 1                                                                                        
  Device Name                                     AMD LIVERPOOL (DRM 2.50.0 / 4.14.4, LLVM 6.0.0)                                          
  Device Vendor                                   AMD                                                                                      
  Device Vendor ID                                0x1002                                                                                   
  Device Version                                  OpenCL 1.1 Mesa 18.0.2                                                                   
  Driver Version