Copyright stuff

This commit is contained in:
Aurora 2016-09-08 23:07:03 +02:00
parent f1cb9630ec
commit 29dcfca608
13 changed files with 30 additions and 24 deletions

View File

@ -22,6 +22,7 @@
/* /*
* Crypto libs from http://github.com/b1l1s/ctr * 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" #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); aes(inbuf - 0x200, exeFsOffset, exeFsSize / AES_BLOCK_SIZE, ncchCTR, AES_CTR_MODE, AES_INPUT_BE | AES_INPUT_NORMAL);
} }
/* ARM9Loader replacement //ARM9Loader replacement
Originally adapted from: https://github.com/Reisyukaku/ReiNand/blob/228c378255ba693133dec6f3368e14d386f2cde7/source/crypto.c#L233 */
void arm9Loader(u8 *arm9Section) void arm9Loader(u8 *arm9Section)
{ {
//Determine the arm9loader version //Determine the arm9loader version

View File

@ -22,6 +22,7 @@
/* /*
* Crypto libs from http://github.com/b1l1s/ctr * 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 #pragma once

View File

@ -22,7 +22,7 @@
/* /*
* Code to print to the screen by mid-kid @CakesFW * 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" #include "draw.h"

View File

@ -20,6 +20,10 @@
* Notices displayed by works containing it. * Notices displayed by works containing it.
*/ */
/*
* Thanks to the everyone who contributed in the development of this file
*/
#include "i2c.h" #include "i2c.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -75,7 +79,7 @@ static inline void i2cWaitBusy(u8 bus_id)
while (*i2cGetCntReg(bus_id) & 0x80); while (*i2cGetCntReg(bus_id) & 0x80);
} }
static inline u32 i2cGetResult(u8 bus_id) static inline bool i2cGetResult(u8 bus_id)
{ {
i2cWaitBusy(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); i2cWaitBusy(bus_id);
*i2cGetDataReg(bus_id) = dev_reg; *i2cGetDataReg(bus_id) = dev_reg;
@ -100,7 +104,7 @@ static u32 i2cSelectDevice(u8 bus_id, u8 dev_reg)
return i2cGetResult(bus_id); return i2cGetResult(bus_id);
} }
static u32 i2cSelectRegister(u8 bus_id, u8 reg) static bool i2cSelectRegister(u8 bus_id, u8 reg)
{ {
i2cWaitBusy(bus_id); i2cWaitBusy(bus_id);
*i2cGetDataReg(bus_id) = reg; *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 bus_id = i2cGetDeviceBusId(dev_id);
u8 dev_addr = i2cGetDeviceRegAddr(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; *i2cGetCntReg(bus_id) = 0xC1;
i2cStop(bus_id, 0); i2cStop(bus_id, 0);
if(i2cGetResult(bus_id)) if(i2cGetResult(bus_id)) return true;
return 1;
} }
*i2cGetCntReg(bus_id) = 0xC5; *i2cGetCntReg(bus_id) = 0xC5;
i2cWaitBusy(bus_id); i2cWaitBusy(bus_id);
} }
return 0; return false;
} }

View File

@ -41,4 +41,4 @@
#define I2C_DEV_GYRO 10 #define I2C_DEV_GYRO 10
#define I2C_DEV_IR 13 #define I2C_DEV_IR 13
u32 i2cWriteRegister(u8 dev_id, u8 reg, u8 data); bool i2cWriteRegister(u8 dev_id, u8 reg, u8 data);

View File

@ -20,7 +20,6 @@
* Notices displayed by works containing it. * Notices displayed by works containing it.
*/ */
/* /*
* Quick Search algorithm adapted from http://igm.univ-mlv.fr/~lecroq/string/node19.html#SECTION00190 * 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 * memcpy, memset32 and memcmp adapted from https://github.com/mid-kid/CakesForeveryWan/blob/557a8e8605ab3ee173af6497486e8f22c261d0e2/source/memfuncs.c

View File

@ -20,7 +20,6 @@
* Notices displayed by works containing it. * Notices displayed by works containing it.
*/ */
/* /*
* Quick Search algorithm adapted from http://igm.univ-mlv.fr/~lecroq/string/node19.html#SECTION00190 * 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 * memcpy, memset32 and memcmp adapted from https://github.com/mid-kid/CakesForeveryWan/blob/557a8e8605ab3ee173af6497486e8f22c261d0e2/source/memfuncs.c

View File

@ -20,6 +20,10 @@
* Notices displayed by works containing it. * Notices displayed by works containing it.
*/ */
/*
* ARM11 modules patching code originally by Subv
*/
#include "patches.h" #include "patches.h"
#include "memory.h" #include "memory.h"
#include "config.h" #include "config.h"
@ -330,7 +334,6 @@ void patchArm11SvcAccessChecks(u32 *arm11SvcHandler)
*arm11SvcHandler = 0xE3B0A001; //MOVS R10, #1 *arm11SvcHandler = 0xE3B0A001; //MOVS R10, #1
} }
//It's mainly Subv's code here
void patchK11ModuleChecks(u8 *pos, u32 size, u8 **freeK11Space) void patchK11ModuleChecks(u8 *pos, u32 size, u8 **freeK11Space)
{ {
/* We have to detour a function in the ARM11 kernel because builtin modules /* We have to detour a function in the ARM11 kernel because builtin modules

View File

@ -20,6 +20,10 @@
* Notices displayed by works containing it. * Notices displayed by works containing it.
*/ */
/*
* ARM11 modules patching code originally by Subv
*/
#pragma once #pragma once
#include "types.h" #include "types.h"

View File

@ -21,8 +21,7 @@
*/ */
/* /*
* pin.c * Code originally by reworks
* Code to manage pin locking for 3ds. By reworks.
*/ */
#include "draw.h" #include "draw.h"

View File

@ -21,9 +21,7 @@
*/ */
/* /*
* pin.h * Code originally by reworks
*
* Code to manage pin locking for 3ds. By reworks.
*/ */
#pragma once #pragma once

View File

@ -21,8 +21,8 @@
*/ */
/* /*
* Screen init code by dark_samus, bil1s, Normmatt, delebile and others. * Screen init code by dark_samus, bil1s, Normmatt, delebile and others
* Screen deinit code by tiniVi. * Screen deinit code by tiniVi
*/ */
#include "screen.h" #include "screen.h"

View File

@ -21,8 +21,8 @@
*/ */
/* /*
* Screen init code by dark_samus, bil1s, Normmatt, delebile and others. * Screen init code by dark_samus, bil1s, Normmatt, delebile and others
* Screen deinit code by tiniVi. * Screen deinit code by tiniVi
*/ */
#pragma once #pragma once