Skip to content

Commit

Permalink
Initial upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanquitas committed Nov 19, 2018
1 parent cc841db commit 098c7dd
Show file tree
Hide file tree
Showing 77 changed files with 11,455 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/Build
*.3gx
193 changes: 193 additions & 0 deletions 3ds.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@

OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)

PHDRS
{
code PT_LOAD FLAGS(5) /* Read | Execute */;
rodata PT_LOAD FLAGS(4) /* Read */;
data PT_LOAD FLAGS(6) /* Read | Write */;
}

SECTIONS
{
/* =========== CODE section =========== */
. = 0x07000100;
__start__ = . ;
.text ALIGN(4) :
{
/* .init */
bootloader.o (.text*)
KEEP( *(.init) )
. = ALIGN(4);

/* .text */
*(.text)
*(.text.*)
*(.glue_7)
*(.glue_7t)
*(.stub)
*(.gnu.warning)
*(.gnu.linkonce.t*)
. = ALIGN(4);

/* .fini */
KEEP( *(.fini) )
. = ALIGN(4);
} : code

/* =========== RODATA section =========== */

.rodata ALIGN(0x4) :
{
*(.rodata)
*(.roda)
*(.rodata.*)
*all.rodata*(*)
*(.gnu.linkonce.r*)
SORT(CONSTRUCTORS)
. = ALIGN(4);
} : rodata

.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } : rodata
__exidx_start = .;
ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } : rodata
__exidx_end = .;

/* =========== DATA section =========== */

.data ALIGN(4):
{
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
CONSTRUCTORS
. = ALIGN(4);
} : data

.tdata ALIGN(4) :
{
__tdata_lma = .;
*(.tdata)
*(.tdata.*)
*(.gnu.linkonce.td.*)
. = ALIGN(4);
__tdata_lma_end = .;
} : data

.tbss ALIGN(4) :
{
*(.tbss)
*(.tbss.*)
*(.gnu.linkonce.tb.*)
*(.tcommon)
. = ALIGN(4);
} : data

.preinit_array ALIGN(4) :
{
PROVIDE (__preinit_array_start = .);
KEEP (*(.preinit_array))
PROVIDE (__preinit_array_end = .);
} : data

.init_array ALIGN(4) :
{
PROVIDE (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE (__init_array_end = .);
} : data

.fini_array ALIGN(4) :
{
PROVIDE (__fini_array_start = .);
KEEP (*(.fini_array))
KEEP (*(SORT(.fini_array.*)))
PROVIDE (__fini_array_end = .);
} : data

.ctors ALIGN(4) :
{
KEEP (*crtbegin.o(.ctors)) /* MUST be first -- GCC requires it */
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} : data

.dtors ALIGN(4) :
{
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} : data

.rel.plt ALIGN(4):
{
*(.__rel_dyn_start)
*(.rel*)
*(.rel.*)
*(.rel.dyn)
*(.__rel_dyn_end)
} : data


.bss ALIGN(4):
{ *(.__bss_start)
*(.dynbss)
*(.bss)
*(.bss.*)
*(.gnu.linkonce.b*)
*(COMMON)
. = ALIGN(4);
*(.__bss_end)
/* Reserve space for the TLS segment of the main thread */
__tls_start = .;
. += + SIZEOF(.tdata) + SIZEOF(.tbss);
__tls_end = .;
} : data

__end__ = ABSOLUTE(.) ;

/* ==================
==== Metadata ====
================== */

/* Discard sections that difficult post-processing */
/DISCARD/ : { *(.group .comment .note) }

/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }

/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */

/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }

/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }

/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }

/* DWARF 2 */
.debug_info 0 : { *(.debug_info) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
}
23 changes: 23 additions & 0 deletions CTRPluginFramework.plgInfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Author: Nanquitas

Version: # Plugin version
Major: 0
Minor: 5
Revision: 1

Targets: # Low TitleId of games which are compatibles with this plugin (0 for all)

Title: CTRPF - Blank Template

Summary: A CTRPF Plugin, with a lot of tools

Description: |
This plugin gives you access to a set of tools to edit your games

Features:
- Memory searcher
- Hex Editor
- Code creator
- Code import from file
- Action Replay engine with extra capabilities
- Super fast screenshot engine
38 changes: 38 additions & 0 deletions Includes/3ds.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifndef _3DS_H
#define _3DS_H

#ifdef __cplusplus
extern "C" {
#endif

#include "types.h"

#include "ctrulib/allocator/newlibHeap.h"
#include "ctrulib/services/ac.h"
#include "ctrulib/services/am.h"
#include "ctrulib/services/apt.h"
#include "ctrulib/services/cfgu.h"
#include "ctrulib/services/fs.h"
#include "ctrulib/services/gspgpu.h"
#include "ctrulib/services/hid.h"
#include "ctrulib/services/irrst.h"

#include "ctrulib/util/utf.h"

#include "ctrulib/env.h"
#include "ctrulib/font.h"
#include "ctrulib/gfx.h"
#include "ctrulib/ipc.h"
#include "ctrulib/os.h"
#include "ctrulib/result.h"
#include "ctrulib/srv.h"
#include "ctrulib/svc.h"
#include "csvc.h"
#include "ctrulib/synchronization.h"
#include "ctrulib/thread.h"

#ifdef __cplusplus
}
#endif

#endif
13 changes: 13 additions & 0 deletions Includes/CTRPluginFramework.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef CTRPLUGINFRAMEWORK_HPP
#define CTRPLUGINFRAMEWORK_HPP

#include "types.h"

using CallbackPointer = void (*)(void);

#include "CTRPluginFramework/Graphics.hpp"
#include "CTRPluginFramework/Menu.hpp"
#include "CTRPluginFramework/System.hpp"
#include "CTRPluginFramework/Utils.hpp"

#endif
7 changes: 7 additions & 0 deletions Includes/CTRPluginFramework/Graphics.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef CTRPLUGINFRAMEWORK_GRAPHICS_HPP
#define CTRPLUGINFRAMEWORK_GRAPHICS_HPP

#include "CTRPluginFramework/Graphics/Color.hpp"
#include "CTRPluginFramework/Graphics/OSD.hpp"

#endif
102 changes: 102 additions & 0 deletions Includes/CTRPluginFramework/Graphics/Color.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#ifndef CTRPLUGINFRAMEWORK_COLOR_HPP
#define CTRPLUGINFRAMEWORK_COLOR_HPP

#include "types.h"
#include <algorithm>
#include <string>

namespace CTRPluginFramework
{
class Color
{
public:

enum class BlendMode
{
Alpha,
Add,
Sub,
Mul,
None
};

Color(void) : r(0), g(0), b(0), a(255) {}
Color(u32 color);
Color(u8 red, u8 green, u8 blue, u8 alpha = 255);

u32 ToU32(void) const;
Color &Fade(double fading);
Color Blend(const Color &color, BlendMode mode) const;

bool operator == (const Color &right) const;
bool operator != (const Color &right) const;
bool operator < (const Color &right) const;
bool operator <= (const Color &right) const;
bool operator > (const Color &right) const;
bool operator >= (const Color &right) const;
Color operator + (const Color &right) const;
Color operator - (const Color &right) const;
Color operator * (const Color &right) const;
Color &operator += (const Color &right);
Color &operator -= (const Color &right);
Color &operator *= (const Color &right);

operator std::string() const
{
char strColor[5] = { 0 };

strColor[0] = 0x1B;
strColor[1] = std::max((u8)1, r);
strColor[2] = std::max((u8)1, g);
strColor[3] = std::max((u8)1, b);

return strColor;
}

union
{
u32 raw;
struct
{
u8 r;
u8 g;
u8 b;
u8 a;
};
};

// All those colors are from https://www.rapidtables.com/web/color/RGB_Color.html
// Some basic colors constants
static const Color Black;
static const Color White;
static const Color Red;
static const Color Lime;
static const Color Blue;
static const Color Yellow;
static const Color Cyan;
static const Color Magenta;
static const Color Silver;
static const Color Gray;
static const Color Maroon;
static const Color Olive;
static const Color Green;
static const Color Purple;
static const Color Teal;
static const Color Navy;

static const Color BlackGrey;
static const Color Brown;
static const Color DarkGrey;
static const Color DeepSkyBlue;
static const Color DimGrey;
static const Color DodgerBlue;
static const Color Gainsboro;
static const Color ForestGreen;
static const Color LimeGreen;
static const Color Orange;
static const Color SkyBlue;
static const Color Turquoise;
};
}

#endif
Loading

0 comments on commit 098c7dd

Please sign in to comment.