{"id":21711843,"url":"https://github.com/gemarcano/libctr11","last_synced_at":"2025-04-12T17:41:58.459Z","repository":{"id":75914371,"uuid":"77590047","full_name":"gemarcano/libctr11","owner":"gemarcano","description":"Baremetal ARM11 library for the Nintendo 3DS","archived":false,"fork":false,"pushed_at":"2023-06-02T00:14:01.000Z","size":105,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T12:03:01.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gemarcano.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-29T06:48:41.000Z","updated_at":"2023-07-25T23:13:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"97f0724d-7ee4-4421-8ed0-90200badf621","html_url":"https://github.com/gemarcano/libctr11","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemarcano%2Flibctr11","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemarcano%2Flibctr11/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemarcano%2Flibctr11/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemarcano%2Flibctr11/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gemarcano","download_url":"https://codeload.github.com/gemarcano/libctr11/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248608132,"owners_count":21132666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T23:30:06.641Z","updated_at":"2025-04-12T17:41:58.454Z","avatar_url":"https://github.com/gemarcano.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"________________________________________________________________________________\n\n(Working title) libctr11\n\nCopyright 2016 Gabriel Marcano\n________________________________________________________________________________\n\n\n--------------------------------------------------------------------------------\nLicensing\n--------------------------------------------------------------------------------\n\nThis project is licensed under the GPL 2 or later licenses, at your choice.\nRefer to COPYING for more licensing information and for the licensing for the\ncode borrowed from other sources.\n\n\n--------------------------------------------------------------------------------\nAbout\n--------------------------------------------------------------------------------\n\nThis library is meant to be a collection of useful routines for ARM11 3DS\ndevelopment. The plan is for it to eventually grow to something like libnds.\nCurrently the main contribution to this library is a generic disk IO framework\nthat has been designed for ease of use and extensibility.\n\nThe library was meant to be linked with LTO, but due to technical limitations of\ndevKitARM with GCC 5.3, it is not. Instead, it is compiled with\n-ffunction-section, so if the final executable uses the gc-section option for\nthe linker, the linker when linking the final executable will be able to throw\nout parts of the library that are not in use, reducing executable size.\n\nNote this library is still in active development and the API is not considered\nstable. Breaking changes will be mentioned in commits at the very least.\n\n\n--------------------------------------------------------------------------------\nDependencies\n--------------------------------------------------------------------------------\n\n - FreeType2 - Used for font handling. Make sure it is installed somewhere that\n    the compiler can pick it up, or use -L and -I to instruct the compiler where\n    to find it. The build tools will attempt to find it within the prefix where\n    libctr11 was configured to be installed in.\n\n - libctrelf - https://github.com/gemarcano/libctrelf\n    Used for helping to parse and handle ELF data.\n\n - Autotools in general. These are used to create the build scripts.\n\n\n--------------------------------------------------------------------------------\nCompiling\n--------------------------------------------------------------------------------\n\nAs a suggestion, it is recommended for one to set up a fixed prefix directory\nand to store a share/config.site under the prefix. For example, if the variable\nCTRARM11 holds the prefix path, then $CTRARM11/share/config.site is where this\nfile would be located. Any variables defined here will be picked up by configure\nupon being run. At a minimum, if other libraries will be installed to the prefix\npath, the config.site should have the following:\n\nCPPFLAGS=\"$CPPFLAGS -I$prefix/include -I$prefix/include/freetype2\"\nLDFLAGS=\"-L$prefix/lib $LDFLAGS\"\n\nThis example assumes that these directories exist, and in particular that\nFreeType2's include path exists in the folder shown above. Refer to:\nhttps://www.gnu.org/software/automake/manual/html_node/config_002esite.html\nfor more information and details about config.site files.\n\nThe Autotools setup assumes that devkitarm is already in the PATH.\n\n # this following line is if the 3ds compiler isn't in the path\n export PATH=${PATH}:${DEVKITPRO}/bin:${DEVKITARM}/bin\n autoreconf -if\n ./configure --host arm-none-eabi --prefix=[lib install path]\n make\n\nExample:\n  export PATH=${PATH}:${DEVKITPRO}/bin:${DEVKITARM}/bin\n  autoreconf -if\n  ./configure --host arm-none-eabi --prefix=\"$HOME/.local/usr/arm-none-eabi-11/\"\n  make -j10\n\n\n--------------------------------------------------------------------------------\nInstallation\n--------------------------------------------------------------------------------\n\nTBD. This library is built using Autotools, so it supports the 'make install'\nand 'make uninstall' targets. Be sure to set --prefix when calling configure\nif either of the preceeding targets will be used, else by default the generated\nMakefile will install to /usr/local/ (most likely)) !\n\nExample (after having compiled):\n  #this will install to the directory specified in prefix, or /usr/local/ if\n  #prefix isn't defined (most likely)!\n  make install\n\nAmong the files installed is an example linker script, in $prefix/share/libctr11.\nIt is recommended to use this linker script to link programs that use libctr11,\nsince it will make sure that libctr11's built-in crt0.o is loaded in the correct\nlocation and that it initializes IO.\n\n\n--------------------------------------------------------------------------------\nUsage\n--------------------------------------------------------------------------------\n\nDepending on where the library is installed, one may need to use -L in one's\nprojects to point the compiler to find the library, then use -lctr11 to cause\nthe linker to link in the static library.\n\nExample:\n  arm-none-eabi-gcc -I$HOME/.local/usr/arm-none-eabi-11/include \\\n    -L$HOME/.local/usr/arm-none-eabi-11/lib -Os -Wall -Wextra -Wpedantic \\\n\thello.c -lctr11 -lfreetype2 -lctrelf\n\nOne setup that is recommended is to export a variable such as, CTRARM11, to\npoint to the root of the prefix where libctr11 is installed. This way, it is\neasier to point to the lib and include directories (such as by using\n$CTRARM11/include and $CTRARM11/lib).\n\nNo start.s or _start.s files are necessary, libctr11 has its own crt0.o built\nin. It (FIXME is supposed to) initializes the 3DS ARM11 MMU to (FIXME WHAT?).\n(FIXME This part is not done )resets the stack, and then calls libc\ninitialization functions and then libctr11, then it jumps to main. It is\nrecommended that any modifications to the environment be done early in main.\n\nFIXME the following isn't true yet\n\nIn addition, if using libctr11's included crt0 functionality, it does support\nthe __constructor__ attribute for functions. Functions with this attribute will\nbe executed before the main initialization function for libctr11 is called.\n\n\n--------------------------------------------------------------------------------\nDocumentation\n--------------------------------------------------------------------------------\n\nThis project uses Doxygen markup in order to facilitate the generation of\ndocumentation, which should be found when generated in the doc/ folder. Each\nheader in the include/ directory should also be well documented and can be used\nas reference for programming.\n\nIn addition, some documentation is hosted in GitHub pages:\n    https://gemarcano.github.io/libctr11/\n\n\n--------------------------------------------------------------------------------\nTesting - FIXME not there yet\n--------------------------------------------------------------------------------\n\nThis project does include a homegrown unit testing framework and some unit tests\nfor this library. See the test/ directory for more information. Note that the\nunit testing payload WILL write to NAND (in theory writes to areas that are\nunused) as a part of unit testing.\n\nTo compile it, change directory to test/, then execute `make test`. The\ngenerated test.bin is an A9LH compatible binary.\n\n\n--------------------------------------------------------------------------------\nIssues/Bugs\n--------------------------------------------------------------------------------\n\nPlease report these to the issue tracker at the repository, and these will be\naddressed as soon as possible, if not at least acknowledged. The more detailed\nthe reports, the more likely they are to be addressed quickly. In particular,\nthe following information can be quite useful when debugging bugs:\n\n - Type of 2/3DS system\n - Operating system being used to compile\n - Release/commit of library in use\n - Steps to reproduce issue\n - Expected behavior\n - Actual behavior\n - ARM9 entry point\n - How the ARM11 payload was launched and set up\n - Any modifications to the library, or extensions\n\n\n--------------------------------------------------------------------------------\nContributing\n--------------------------------------------------------------------------------\n\nPull requests are welcome. All requests will be looked at in detail, and must be\ndocumented in a similar fashion as the rest of the code for this project. In\nparticular, it is unlikely (but not impossible) that code that emmits warnings\nwith the warnings in use by this library would be merged without first fixing/\naddressing what is causing the warnings to be emitted.\n\n\n--------------------------------------------------------------------------------\nCredits\n--------------------------------------------------------------------------------\n\n - #3dshacks @ Rizon for starting me on my path to 3DS homebrew development\n - #Cakey @ Freenode for the continued development support\n - #3dsdev @ EFNet for the occasional help answering questions\n - d0k3 for some code use in this library and for suggestions\n - dark_samus for helping to develop A9LH stuff in Cakey, which drove for the\n    development of this library\n - Delebile for publishing the public arm9loaderhax implementation, making using\n    and testing this library possible (or less of a pain)\n - Aurora, et. al (you know who you are, I hope) for for general development\n    help and brainstorming\n - Normmatt for yelling at me for screwing up his sdmmc code :) Also a lot of\n    other general 3DS development stuff\n - bilis for his ctr library (a small amount of code from that is used) and for\n    his QEMU implementation of the 3DS ARM9 environment.\n\n - See COPYING for details about code usage from other sources\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgemarcano%2Flibctr11","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgemarcano%2Flibctr11","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgemarcano%2Flibctr11/lists"}