Skip to content

Instantly share code, notes, and snippets.

@nico-abram
nico-abram / migrate_firefox_history.sqlite3
Created September 15, 2022 02:44
sqlite3 commands to migrate old firefox places.sqlite history
-- sqlite3 commands to migrate old firefox places.sqlite history
-- Run the sqlite command line (https://www.sqlite.org/cli.html)
-- on a copy of your backed up places.sqlite (sqlite3.exe places.sqlite), and run these commands:
DROP INDEX moz_places_faviconindex;
ALTER TABLE moz_places DROP COLUMN favicon_id;
ALTER TABLE moz_places ADD COLUMN origin_id INTEGER;
UPDATE moz_places SET origin_id=NULL;
ALTER TABLE moz_places ADD COLUMN site_name INTEGER;
fn image_dist_naivef32(
x_offset: usize,
y_offset: usize,
search_img: &[f32],
search_w: usize,
subimage: &[f32],
w: usize,
h: usize,
use std::os::windows::ffi::OsStrExt;
type BCRYPT_ALG_HANDLE = usize;
type wchar_t = u16;
type WCHAR = wchar_t;
type LPCWSTR = *const WCHAR;
type c_uchar = u8;
type UCHAR = c_uchar;
type PUCHAR = *mut UCHAR;
type c_ulong = u32;
int onePercent = std::max(static_cast<int>(scores.size() / 100 * 5), 1);
int scoreindex = 0;
// Add this include
#include <cstdint>
mutex songVectorPtrMutex;
vector<std::uintptr_t> currentlyLockedSongs;
// This is meant to ensure mutual exclusion for a song
class SongLock
{
use std::convert::TryInto;
use std::ffi::{c_void, OsStr};
use std::iter::once;
use std::os::windows::ffi::OsStrExt;
use winapi::shared::{ntdef::VOID, windef::HDC};
use winapi::um::wingdi::{
StretchDIBits, BITMAPINFO, BITMAPINFOHEADER, BI_RGB, DIB_RGB_COLORS, RGBQUAD, SRCCOPY,
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Gnuplot not found, disabling plotting
Benchmarking hashbrown_rwlock_insert_100k_u64_u64
Benchmarking hashbrown_rwlock_insert_100k_u64_u64: Warming up for 3.0000 s
Benchmarking hashbrown_rwlock_insert_100k_u64_u64: Collecting 100 samples in estimated 79.054 s (5050 iterations)
Benchmarking hashbrown_rwlock_insert_100k_u64_u64: Analyzing
diff --git a/rgba.log b/mgba.log
index 5eab33c..d78aa69 100644
--- a/rgba.log
+++ b/mgba.log
@@ -1771436,11 +1771436,11 @@ r0:630 r1:e0 r2:50003ec r3:e0 r4:e0 r5:1 r6:4000200 r7:3003b2c r8:0 r9:0 r10:0 r
N:false C:false Z:false V:false I:false F:true T:false mode:1f
opcode 590478:e2113102
r0:630 r1:e0 r2:50003ec r3:0 r4:e0 r5:1 r6:4000200 r7:3003b2c r8:0 r9:0 r10:0 r11:0 r12:3008e5c r13:3007ea0 r14:1731 r15:3bc
N:false C:true Z:true V:false I:false F:true T:false mode:1f
opcode 590479:42611000
pub trait AsBoolSlice {
fn is_set(self, mask: u8) -> bool;
fn is_set_n(self, n: u8) -> bool;
fn as_bools(self) -> [bool; 8];
}
impl AsBoolSlice for u8 {
#[inline]
fn is_set(self, mask: u8) -> bool {
(self & mask) == mask
trait AsBoolSlice {
fn is_set(self, mask: u8) -> bool;
fn is_set_n(self, n: u8) -> bool;
fn as_bools(self) -> [bool; 8];
}
impl AsBoolSlice for u8 {
fn is_set(self, mask: u8) -> bool {
(self & mask) == mask
}
// Data Processing or PSR transfer
pub fn PSR(cpu: &mut Cpu, opcode: u32) {
let immediate = as_extra_flag(opcode);
let set_condition_flags = (opcode & 0x0010_0000) != 0;
let (rn, rd, _, _, _) = as_usizes(opcode);
let (_, _, third_byte, second_byte, lowest_byte) = as_bytes(opcode);
let rn = *cpu.reg_mut(rn);
let psr_opcode = ((opcode & 0x01E0_0000) >> 25) as u8;
let op2: u32 = if immediate {