From 29dcfca608f501d8de44d6f095322398f2748e2b Mon Sep 17 00:00:00 2001 From: Aurora Date: Thu, 8 Sep 2016 23:07:03 +0200 Subject: [PATCH] Copyright stuff --- source/crypto.c | 4 ++-- source/crypto.h | 1 + source/draw.c | 2 +- source/i2c.c | 17 ++++++++++------- source/i2c.h | 4 ++-- source/memory.c | 1 - source/memory.h | 1 - source/patches.c | 5 ++++- source/patches.h | 4 ++++ source/pin.c | 3 +-- source/pin.h | 4 +--- source/screen.c | 4 ++-- source/screen.h | 4 ++-- 13 files changed, 30 insertions(+), 24 deletions(-) diff --git a/source/crypto.c b/source/crypto.c index 30f4b5f..ee37fbb 100755 --- a/source/crypto.c +++ b/source/crypto.c @@ -22,6 +22,7 @@ /* * Crypto libs from http://github.com/b1l1s/ctr +* ARM9Loader code originally adapted from https://github.com/Reisyukaku/ReiNand/blob/228c378255ba693133dec6f3368e14d386f2cde7/source/crypto.c#L233 */ #include "crypto.h" @@ -383,8 +384,7 @@ void decryptExeFs(u8 *inbuf) aes(inbuf - 0x200, exeFsOffset, exeFsSize / AES_BLOCK_SIZE, ncchCTR, AES_CTR_MODE, AES_INPUT_BE | AES_INPUT_NORMAL); } -/* ARM9Loader replacement - Originally adapted from: https://github.com/Reisyukaku/ReiNand/blob/228c378255ba693133dec6f3368e14d386f2cde7/source/crypto.c#L233 */ +//ARM9Loader replacement void arm9Loader(u8 *arm9Section) { //Determine the arm9loader version diff --git a/source/crypto.h b/source/crypto.h index be2d3b4..ac832e5 100755 --- a/source/crypto.h +++ b/source/crypto.h @@ -22,6 +22,7 @@ /* * Crypto libs from http://github.com/b1l1s/ctr +* ARM9Loader code originally adapted from https://github.com/Reisyukaku/ReiNand/blob/228c378255ba693133dec6f3368e14d386f2cde7/source/crypto.c#L233 */ #pragma once diff --git a/source/draw.c b/source/draw.c index 14b8b0e..73e603e 100644 --- a/source/draw.c +++ b/source/draw.c @@ -22,7 +22,7 @@ /* * Code to print to the screen by mid-kid @CakesFW -* https://github.com/mid-kid/CakesForeveryWan/ +* https://github.com/mid-kid/CakesForeveryWan */ #include "draw.h" diff --git a/source/i2c.c b/source/i2c.c index c599cfd..f2b479d 100644 --- a/source/i2c.c +++ b/source/i2c.c @@ -20,6 +20,10 @@ * Notices displayed by works containing it. */ +/* +* Thanks to the everyone who contributed in the development of this file +*/ + #include "i2c.h" //----------------------------------------------------------------------------- @@ -75,7 +79,7 @@ static inline void i2cWaitBusy(u8 bus_id) while (*i2cGetCntReg(bus_id) & 0x80); } -static inline u32 i2cGetResult(u8 bus_id) +static inline bool i2cGetResult(u8 bus_id) { i2cWaitBusy(bus_id); @@ -91,7 +95,7 @@ static void i2cStop(u8 bus_id, u8 arg0) //----------------------------------------------------------------------------- -static u32 i2cSelectDevice(u8 bus_id, u8 dev_reg) +static bool i2cSelectDevice(u8 bus_id, u8 dev_reg) { i2cWaitBusy(bus_id); *i2cGetDataReg(bus_id) = dev_reg; @@ -100,7 +104,7 @@ static u32 i2cSelectDevice(u8 bus_id, u8 dev_reg) return i2cGetResult(bus_id); } -static u32 i2cSelectRegister(u8 bus_id, u8 reg) +static bool i2cSelectRegister(u8 bus_id, u8 reg) { i2cWaitBusy(bus_id); *i2cGetDataReg(bus_id) = reg; @@ -111,7 +115,7 @@ static u32 i2cSelectRegister(u8 bus_id, u8 reg) //----------------------------------------------------------------------------- -u32 i2cWriteRegister(u8 dev_id, u8 reg, u8 data) +bool i2cWriteRegister(u8 dev_id, u8 reg, u8 data) { u8 bus_id = i2cGetDeviceBusId(dev_id); u8 dev_addr = i2cGetDeviceRegAddr(dev_id); @@ -125,12 +129,11 @@ u32 i2cWriteRegister(u8 dev_id, u8 reg, u8 data) *i2cGetCntReg(bus_id) = 0xC1; i2cStop(bus_id, 0); - if(i2cGetResult(bus_id)) - return 1; + if(i2cGetResult(bus_id)) return true; } *i2cGetCntReg(bus_id) = 0xC5; i2cWaitBusy(bus_id); } - return 0; + return false; } \ No newline at end of file diff --git a/source/i2c.h b/source/i2c.h index e0a262f..0099d61 100644 --- a/source/i2c.h +++ b/source/i2c.h @@ -21,7 +21,7 @@ */ /* -* Thanks to the everyone who contributed in the development of this file +* Thanks to the everyone who contributed in the development of this file */ #pragma once @@ -41,4 +41,4 @@ #define I2C_DEV_GYRO 10 #define I2C_DEV_IR 13 -u32 i2cWriteRegister(u8 dev_id, u8 reg, u8 data); \ No newline at end of file +bool i2cWriteRegister(u8 dev_id, u8 reg, u8 data); \ No newline at end of file diff --git a/source/memory.c b/source/memory.c index 48d4060..4f761c9 100644 --- a/source/memory.c +++ b/source/memory.c @@ -20,7 +20,6 @@ * Notices displayed by works containing it. */ - /* * Quick Search algorithm adapted from http://igm.univ-mlv.fr/~lecroq/string/node19.html#SECTION00190 * memcpy, memset32 and memcmp adapted from https://github.com/mid-kid/CakesForeveryWan/blob/557a8e8605ab3ee173af6497486e8f22c261d0e2/source/memfuncs.c diff --git a/source/memory.h b/source/memory.h index 28c6519..237df7d 100644 --- a/source/memory.h +++ b/source/memory.h @@ -20,7 +20,6 @@ * Notices displayed by works containing it. */ - /* * Quick Search algorithm adapted from http://igm.univ-mlv.fr/~lecroq/string/node19.html#SECTION00190 * memcpy, memset32 and memcmp adapted from https://github.com/mid-kid/CakesForeveryWan/blob/557a8e8605ab3ee173af6497486e8f22c261d0e2/source/memfuncs.c diff --git a/source/patches.c b/source/patches.c index 0dfdad5..79d8cdd 100644 --- a/source/patches.c +++ b/source/patches.c @@ -20,6 +20,10 @@ * Notices displayed by works containing it. */ +/* +* ARM11 modules patching code originally by Subv +*/ + #include "patches.h" #include "memory.h" #include "config.h" @@ -330,7 +334,6 @@ void patchArm11SvcAccessChecks(u32 *arm11SvcHandler) *arm11SvcHandler = 0xE3B0A001; //MOVS R10, #1 } -//It's mainly Subv's code here void patchK11ModuleChecks(u8 *pos, u32 size, u8 **freeK11Space) { /* We have to detour a function in the ARM11 kernel because builtin modules diff --git a/source/patches.h b/source/patches.h index a82efd9..0c2d652 100644 --- a/source/patches.h +++ b/source/patches.h @@ -20,6 +20,10 @@ * Notices displayed by works containing it. */ +/* +* ARM11 modules patching code originally by Subv +*/ + #pragma once #include "types.h" diff --git a/source/pin.c b/source/pin.c index 4d3e1f2..e3f4f40 100644 --- a/source/pin.c +++ b/source/pin.c @@ -21,8 +21,7 @@ */ /* -* pin.c -* Code to manage pin locking for 3ds. By reworks. +* Code originally by reworks */ #include "draw.h" diff --git a/source/pin.h b/source/pin.h index cf502ff..d94d422 100644 --- a/source/pin.h +++ b/source/pin.h @@ -21,9 +21,7 @@ */ /* -* pin.h -* -* Code to manage pin locking for 3ds. By reworks. +* Code originally by reworks */ #pragma once diff --git a/source/screen.c b/source/screen.c index 1707d37..eeeb6d5 100644 --- a/source/screen.c +++ b/source/screen.c @@ -21,8 +21,8 @@ */ /* -* Screen init code by dark_samus, bil1s, Normmatt, delebile and others. -* Screen deinit code by tiniVi. +* Screen init code by dark_samus, bil1s, Normmatt, delebile and others +* Screen deinit code by tiniVi */ #include "screen.h" diff --git a/source/screen.h b/source/screen.h index a7cb528..312face 100644 --- a/source/screen.h +++ b/source/screen.h @@ -21,8 +21,8 @@ */ /* -* Screen init code by dark_samus, bil1s, Normmatt, delebile and others. -* Screen deinit code by tiniVi. +* Screen init code by dark_samus, bil1s, Normmatt, delebile and others +* Screen deinit code by tiniVi */ #pragma once