This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PSC fill with total size of 3 MiB: | |
Single fill: 3603684130 byte/s, 3436 MiB/s. | |
2 fills in VRAM bank 0: 3799706967 byte/s, 3623 MiB/s. | |
2 fills (one for each VRAM bank): 7174738159 byte/s, 6842 MiB/s. | |
PPF texture copy: | |
Bank 0 to upper half of bank 0 (1.5 MiB): 1850370283 byte/s, 1764 MiB/s. | |
Bank 0 to bank 1 (3 MiB): 2977645889 byte/s, 2839 MiB/s. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ License: Do whatever you want. | |
.syntax unified | |
.cpu arm7tdmi | |
.fpu softvfp | |
@ Based on https://web.archive.org/web/20240111232601/https://gist.github.com/merryhime/797c523724e2dc02ada86a1cfadea3ee | |
@ Thanks to merryhime for discovering this trick. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static u8 crc7(const u8 *data, u32 len) | |
{ | |
u32 crc = 0; // u32 to avoid "and rX, rX, #0xFF" in the bit loop. | |
while(len--) | |
{ | |
crc ^= *data++; | |
for(u32 i = 0; i < 8; i++) | |
{ | |
if(crc & 0x80u) crc ^= 0x89u; | |
crc <<= 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// License: Do what you want. I don't care. | |
#include <algorithm> | |
#include <math.h> | |
#include <cstdio> | |
#include <cinttypes> | |
#include "lodepng.h" | |
typedef uint8_t u8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.cpu arm7tdmi | |
.fpu softvfp | |
.macro BEGIN_ASM_FUNC name, type=arm, linkage=global, section=text | |
.section .\section\().\name, "ax", %progbits | |
.if \type == thumb | |
.align 1 | |
.thumb | |
.else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include "mem_map.h" | |
#include "types.h" | |
#include "util.h" | |
#include "arm9/hardware/gamecard.h" | |
#include "arm9/ncch.h" | |
#include "arm9/hardware/crypto.h" | |
#include "arm9/hardware/timer.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <3ds.h> | |
#define REVERSE_INTERVAL (60u * 15) | |
static void setLcdFill(const u32 val) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 MiB: | |
vector: 15926306 | |
struct: 16319471 | |
1 KiB: | |
vector: 5597 | |
struct: 5758 | |
128 bytes: | |
vector: 1057/1085 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ u32 pcTest(void) | |
@ Expected result is pc + 8 but it's pc + 10 on ARM7. | |
BEGIN_ASM_FUNC pcTest | |
ldr pc, =pcTest_mov + 2 | |
pcTest_mov: | |
mov r0, pc | |
bx lr | |
END_ASM_FUNC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <inttypes.h> | |
#include <gba_console.h> | |
#include <gba_video.h> | |
#include <gba_interrupt.h> | |
#include <gba_systemcalls.h> | |
#include <gba_input.h> | |
#include <gba_sound.h> | |
#include <gba_timers.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
NewerOlder