Skip to content

Instantly share code, notes, and snippets.

@Miouyouyou
Miouyouyou / ias.sh
Created September 20, 2017 08:33
Install As System for Android ... Not tested since a while
APP=("$1")
adb shell su -c cp /data/app/"$APP-?.apk" /sdcard
adb shell su -c pm uninstall "$APP"
adb shell su -c mount -o remount /system
adb shell su -c cp /sdcard/$APP-?.apk /system/app
adb shell su -c cp /sdcard/$APP-?.apk /system/priv-app
adb shell su -c chown root:root /system/app/$APP-?.apk
adb shell su -c chown root:root /system/priv-app/$APP-?.apk
adb shell su -c chmod 0644 /system/app/$APP-?.apk
@Miouyouyou
Miouyouyou / MethodsHelpers.java
Created December 16, 2017 22:35
Get the signatures of functions declared in Java Class, at runtime, using Java.lang.reflect methods
package your.package.name;
import java.lang.reflect.Method;
import java.util.HashMap;
import android.util.Log;
public class MethodsHelpers {
static public HashMap<Class, String> primitive_types_codes;
Device: RDRAM: Use the R4300 helpers to get the R4300 registers
Since the "regs" member is not available on the r4300_core
structure when enabling ARM DYNAREC.
Signed-off-by: Miouyouyou (Myy) <[email protected]>
---
src/device/rdram/rdram.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@Miouyouyou
Miouyouyou / 0005-drivers-mmc-dw-mci-rockchip-Handle-ASUS-Tinkerboard.patch
Created January 7, 2018 01:04
ASUS Tinkerboard reboot patch. The less ugly one.
From 302cd9b8a9f1f8a7735fabea3b9a7645dc40f9cc Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <[email protected]>
Date: Sun, 7 Jan 2018 01:52:44 +0100
Subject: [PATCH] drivers: mmc: dw-mci-rockchip: Handle ASUS Tinkerboard reboot
On ASUS Tinkerboard systems, if the SDMMC hardware is shutdown before
rebooting, the system will be dead, as the SDMMC is the only way to
boot anything, and the hardware doesn't power up the SDMMC hardware
automatically when rebooting.
@Miouyouyou
Miouyouyou / 0001-Various-buggy-Rocky-and-GLES-patches.patch
Created February 14, 2018 21:20
Buggy patches for Reicast... It still does not work but it adds a RK3288 (Tinkerboard) option in the Makefile
From d21c904098ed99638e9b710fc065a03f7c4860a6 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <[email protected]>
Date: Wed, 14 Feb 2018 21:19:08 +0000
Subject: [PATCH] Various buggy Rocky and GLES patches
---
core/rend/gles/gles.cpp | 8 +++++++-
core/rend/gles/gles.h | 3 +++
shell/linux/Makefile | 20 ++++++++++++++++----
3 files changed, 26 insertions(+), 5 deletions(-)
@Miouyouyou
Miouyouyou / fill_pixels.S
Created February 28, 2018 08:59
Fill the pixels of ANativeWindow_Buffer *, using a static 1080p setup (bad)
.text
/* Arguments :
* - x0 : Address of the buffer
* C style :
* fill_pixels (ANativeWindow_Buffer* buffer)
* C style usage example :
* ANativeWindow_Buffer buffer;
* ANativeWindow_lock(engine->app->window, &buffer, NULL);
* fill_pixels(&buffer);
@Miouyouyou
Miouyouyou / zebra_print_header.txt
Created April 3, 2018 13:37
Generate EPL code allowing you to print a QRCode with a Zebra 2746e (European and American versions)
; !! IF YOU'RE OPENING THIS FILE ON UNIX/LINUX SYSTEMS, KEEP THE CRLF !!
; !! USE unix2dos IF YOUR EDITOR IS TOO DUMB TO KEEP THEM !!
; This is a comment (Assembly-like comments)
; Set the form length (Distance between each print ??)
Q0001,0
; The label width in dots
q831
; Set the double buffer mode (For what purpose, I have no idea)
rN
; Print speed : [2-6] = [level_selected*25] mm/s -> (2 == 2*25 mm/s) -> 50 mm/s
@Miouyouyou
Miouyouyou / convert.rb
Last active August 4, 2018 23:45
Binary file to C int array in ruby
#!/bin/ruby
require "fileutils"
MAX_NUMBERS_PER_LINE = 4
if ARGV.length != 1
puts "./convert.rb path/to/filename > output.c"
abort
end
@Miouyouyou
Miouyouyou / elf_linker.c
Last active March 23, 2022 10:37
Quick and very dirty ARM64 ( AARCH64 ) ELF linker
#include <stdint.h>
#include <elf.h>
#include <sections/data.h>
#include <string.h>
#include <assert.h>
#define INSTRUCTION_SIZE 9*4
#define DATA_SIZE 16
struct texture_metadata {
char const * __restrict const filepath;
GLenum target;
GLint mimaplevel;
GLint gl_pixel_format;
GLsizei width;
GLsizei height;
GLint border;
GLenum pixel_format;
GLenum bits_format;