{"id":15424800,"url":"https://github.com/antoniond/architectds","last_synced_at":"2025-04-19T15:37:56.656Z","repository":{"id":220382220,"uuid":"734913845","full_name":"AntonioND/architectds","owner":"AntonioND","description":"Build system for BlocksDS.","archived":false,"fork":false,"pushed_at":"2025-03-26T18:13:17.000Z","size":3924,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T21:44:06.041Z","etag":null,"topics":["blocksds"],"latest_commit_sha":null,"homepage":"https://blocksds.skylyrac.net/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AntonioND.png","metadata":{"files":{"readme":"readme.rst","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-12-23T02:17:29.000Z","updated_at":"2025-03-26T18:13:08.000Z","dependencies_parsed_at":"2024-05-31T18:47:06.906Z","dependency_job_id":"2a50f808-113c-46b5-a6fe-f3d0c1523c03","html_url":"https://github.com/AntonioND/architectds","commit_stats":{"total_commits":26,"total_committers":3,"mean_commits":8.666666666666666,"dds":0.07692307692307687,"last_synced_commit":"f04dafa739837bd0336bf208a627ca165d1c73bf"},"previous_names":["antoniond/architectds"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonioND%2Farchitectds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonioND%2Farchitectds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonioND%2Farchitectds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonioND%2Farchitectds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AntonioND","download_url":"https://codeload.github.com/AntonioND/architectds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249220841,"owners_count":21232421,"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":["blocksds"],"created_at":"2024-10-01T17:48:48.760Z","updated_at":"2025-04-19T15:37:56.649Z","avatar_url":"https://github.com/AntonioND.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"ArchitectDS\n===========\n\nThis is a build system for NDS ROMs meant to be used with BlocksDS. It allows\nyou to easily define source directories, libraries, etc; and define the location\nof assets and their destination (NitroFS or CPU data).\n\n- ARM9 and ARM7 binaries can have a custom list of libraries, definitions and\n  source code directories.\n\n- If an ARM7 isn't defined, it will use the default ARM7 binary of BlocksDS.\n\n- Assets such as images and audio files can be converted as part of the build\n  process and added to NitroFS or the CPU binary as data.\n\n- An arbitrary number of DSP binaries can be built, and they can be stored in\n  NitroFS or in a CPU binary as data.\n\n- Popular NDS libraries and tools are supported:\n\n  - grit: Converted assets are saved as GRF files in NitroFS, or as binary files\n    if they need to be added as data to a CPU binary as an array.\n\n  - Maxmod: Soundbanks can be generated to NitroFS or added as data to the CPU.\n\n  - NFlib: Assets are converted and saved to NitroFS. Shared palettes are\n    supported.\n\n  - Nitro Engine: Static and animated models are supported.\n\n  - ptexconv: Used to generate textures in Tex4x4 format.\n\n  - libxm7, dswifi, gbajpg and other libraries that don't require special\n    tooling are also supported.\n\nNote that this is still an early version of the build system. If you need a\nfeature, or a suggestion, feel free to create issues in the repository.\n\nFor an example of using Nitro Engine, NFlib and libnds at the same time, check\n`this example \u003cexamples/nitro_engine/using_nflib\u003e`__.\n\nFor an example of using the DSP, check `this example \u003cexamples/libnds/dsp\u003e`__.\n\nFor an example of debug/release builds, check `this example\n\u003cexamples/libnds/debug_build\u003e`__.\n\nDependencies\n------------\n\nYou need to install Ninja and Python 3. In Ubuntu or Debian simply run:\n\n.. code:: bash\n\n    sudo apt install python3 ninja-build\n\nSetup\n-----\n\nIf you don't want to install it in your system, you can just copy the\n``architectds`` folder to your project. Then, you will be able to import the module\nwith:\n\n.. code:: python\n\n    from architectds import *\n\nIf you want to install it in your system instead of copying the folder, follow\nthe steps below:\n\n.. code:: bash\n\n    # Create and activate venv\n    sudo apt install python3-venv\n    python3 -m venv env\n    source env/bin/activate\n\n    # Install dependencies\n    pip3 install wheel setuptools\n\n    # Create wheel\n    python3 setup.py bdist_wheel\n\n    # Install wheel\n    pip3 install dist/architectds-*-py3-none-any.whl\n\nExamples\n--------\n\nThere are lots of examples that show how to use most features. To build any of\nthe examples, run ``python3 build.py`` in the folder of the example.\n\n- **gbajpeg/**:\n\n  - ``load_from_nitrofs``: Load and decode a JPEG image from NitroFS.\n\n  - ``load_from_ram``: Load and decode a JPEG image from RAM.\n\n- **gl2d/**: Examples that use the GL2D library included with libnds.\n\n  - ``sprite_set``: Generate a sprite set from multiple PNG files and add it to\n    the ARM9 binary as data.\n\n  - ``sprite_set_nitrofs``: Generate a sprite set from multiple PNG files and\n    add it to NitroFS.\n\n- **libnds/**: Examples with the default BlocksDS libraries.\n\n  - ``all``: It shows how to do most things supported by libnds and other very\n    common libraries:\n\n    - DSP: One binary stored in NitroFS, one binary added to the ARM9 as data.\n    - NitroFS: Graphics files converted with grit to GRF format, audio files\n      converted with mmutil into a soundbank.\n    - ARM9: Graphics files converted with grit and added as data. Data files\n      added to the ARM9 binary. Audio files converted into a soundbank with\n      mmutil and added to the ARM9 binary.\n    - ARM7: With Maxmod and dswifi. Data files are added to it.\n    - NDS: NitroFS directories. Custom ROM title, subtitles, and icon.\n\n  - ``arm9``: Simple ROM with only a source file for the ARM9 and default ARM7.\n\n  - ``arm9_arm7``: Example of developing custom ARM9 and ARM7 binaries.\n\n  - ``arm9_nitrofs``: Simple ROM with only a source file for the ARM9, default\n    ARM7, and NitroFS data files added to the filesystem by the developer.\n\n  - ``dsp``: Example of loading DSP binaries from memory and NitroFS.\n\n  - ``opengl``: Example of converting graphics and displaying them with OpenGL.\n\n- **libxm7/**:\n\n  - ``play_songs``: Example that uses libxm7 instead of Maxmod to play music.\n\n- **maxmod/**:\n\n  - ``audio_as_data``: Example of using Maxmod with ARM9 data as a soundbank.\n\n  - ``audio_in_nitrofs``: Example of using Maxmod with a soundbank in NitroFS.\n\n- **nflib/**: NFlib examples ported to ArchitectDS.\n\n  - ``3dsprites``: Tiled backgrounds and 3D sprites.\n\n  - ``collisions``: Multiple examples that show pixel-perfect collisions, as\n    well as tile-based collisions.\n\n  - **graphics/**:\n\n    - ``affine``: Affine backgrounds with and without shared palettes.\n\n    - ``animatedbg``: Animated tiled background.\n\n    - ``backbuffer3``: 16 bit background.\n\n    - ``bg``: Tiled backgrounds.\n\n    - ``bg16bits``: 16 bit backgrounds.\n\n    - ``bgmixed``: Tiled and 8 bit backgrounds. 256 color sprites. Custom fonts.\n\n    - ``bgtiled_spr256``: Tiled backgrounds, 256 color sprites, 8 bit\n      backgrounds with shared palettes.\n\n  - ``textdemo``: Tiled backgrounds and custom fonts.\n\n- **nitro_engine/**: Nitro Engine examples ported to ArchitectDS.\n\n  - ``animated_model``: MD5 animated model and 16 bit texture converted with\n    grit added to the ARM9 as binary data.\n\n  - ``error_handling``: Shows how to have release and debug builds with debug\n    messages.\n\n  - ``filesystem_animated_model``: MD5 animated model and 16 bit texture\n    converted with grit and added to NitroFS.\n\n  - ``filesystem_compressed_texture``: Texture converted to Tex4x4 with ptexconv\n    and saved to NitroFS.\n\n  - ``filesystem_paletted_texture``: Paletted textures converted with grit to\n    GRF format and saved to NitroFS.\n\n  - ``filesystem_simple_model``: OBJ static model and 16 bit texture converted\n    with grit and added to NitroFS.\n\n  - ``model_with_vertex_color``: OBJ static model with vertex color information.\n\n  - ``paletted_texture``: Paletted textures converted with grit to GRF format\n    and saved to the ARM9 as binary data.\n\n  - ``sdroot_animated_model``: MD5 animated model and 16 bit texture converted\n    with grit and stored in the SD card of a flashcard or the DSi SD slot.\n\n  - ``simple_model``: OBJ static model and 16 bit texture converted with grit\n    and added to the ARM9 as binary data.\n\n  - ``specular_material``: OBJ static model and 16 bit texture converted with\n    grit and added to the ARM9 as binary data.\n\nUsage guide\n-----------\n\nWith this build system you need to create an ``Arm9Binary`` object, with a list\nof source code directories, defines, include directories, libraries (and things\nlike CFLAGS, ASFLAGS, CXXFLAGS and LDFLAGS). This object can take any number of\nassets through some functions like ``add_data()``, ``add_grit()`` or\n``add_tlf()``. Check the examples for more information.\n\nBy default, assets functions will use a default path as destination. To define a\ncustom output path in any of the functions that include assets, set ``out_dir``\nto the desired path:\n\n.. code:: python\n\n    # This will use the default path:\n    arm9.add_grit(['graphics/trees'])\n    arm9.add_grit(['graphics/food'])\n\n    # This will set a different path:\n    arm9.add_grit(['graphics/animals'], 'graphics/animals')\n    arm9.add_grit(['graphics/rocks'], 'graphics/rocks')\n\nWhen you're happy with your ARM9 binary, you can do the same thing with an\n``Arm7Binary`` object if you want a custom ARM7 binary. If you don't create one,\nthe default BlocksDS binary will be used. You can also add assets to this binary,\nbut it only makes sense to use ``add_data()``.\n\nYou can also create a ``NitroFS`` object. This object is only used for assets\nthat need to be converted. For folders that need to be added as they are, check\nthe ``NdsRom`` class below. The ``NitroFS`` object can take any number of\ngraphics files to be converted with ``grit`` or ``ptexconv``, audio files that\nare converted with ``mmutil``, or even 3D models to be used with Nitro Engine.\n\nIf you want to store your files in your SD card instead of the NitroFS\nfilesystem, you can create a ``FatFS`` object instead. It behaves the same way\nas ``NitroFS``, but it will use your chosen folder as a root folder for the\ngenerated files. You will need to copy them to your SD card yourself.\n\nIf you want to create DSP binaries, you need to create ``TeakBinary`` objects in\na similar way as ARM binaries.\n\nFinally, once you have all your objects, you need to create an ``NdsRom``\nobject. This object takes a list of binaries (NitroFS, ARM9, ARM7, DSP) and adds\nthem to the ROM. It can also take a list of paths to directories to be added to\nNitroFS right as they are without any modifications. All directories passed in\nthis list will be added to the root of the filesystem. If a file is found in\nmultiple trees it will cause an error.\n\nAs mentioned previously, if no ARM7 binary is added to the ROM, the default\nBlocksDS binary will be used.\n\nYou can also define the header title and subtitles, and the game icon here.\n\nOnce your objects are ready, ``run_command_line_arguments()`` will check the\narguments passed to the python script:\n\n- ``python3 build.py``: Create a ``ninja.build`` file and build the ROM.\n  Equivalent to ``python3 build.py --build``.\n\n- ``python3 build.py --clean``: Clean all build files.\n\n- ``python3 build.py --graph``: If you have ``graphviz`` installed in your\n  system, this will generate a PNG file with the dependency graph of your\n  project.\n\n- ``python3 build.py --ninja``: Create a ``ninja.build`` file and exit.\n\nNote that this is just a python script. At any point in the script you can check\n``sys.argv`` for your own arguments and change the build definitions based on\nthem. The ``debug_build`` example in the ``libnds`` folder and the\n``error_handling`` example in the ``nitro_engine`` folder use this to handle\ndebug and release builds differently in the same project.\n\nAlso, once you have the ``build.ninja`` file, if you want to invoke ``ninja`` by\nitself without the wrapper script, make sure that you set the environment\nvariable ``BLOCKSDS`` to the path of your installation of BlocksDS (for example,\nin Linux, ``export BLOCKSDS=/opt/blocksds/core``).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantoniond%2Farchitectds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantoniond%2Farchitectds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantoniond%2Farchitectds/lists"}