{"id":21145411,"url":"https://github.com/etchedpixels/libtile","last_synced_at":"2025-10-13T18:39:56.869Z","repository":{"id":189124339,"uuid":"632934772","full_name":"EtchedPixels/LibTile","owner":"EtchedPixels","description":"Some experiments in a portable tile based graphcis library","archived":false,"fork":false,"pushed_at":"2023-04-26T16:58:12.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T18:39:56.151Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EtchedPixels.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-26T12:36:58.000Z","updated_at":"2023-12-09T12:00:42.000Z","dependencies_parsed_at":"2023-08-18T11:44:31.028Z","dependency_job_id":"304e93ac-7e0b-4bf4-895e-d022fdd0d74c","html_url":"https://github.com/EtchedPixels/LibTile","commit_stats":null,"previous_names":["etchedpixels/libtile"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EtchedPixels/LibTile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EtchedPixels%2FLibTile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EtchedPixels%2FLibTile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EtchedPixels%2FLibTile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EtchedPixels%2FLibTile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EtchedPixels","download_url":"https://codeload.github.com/EtchedPixels/LibTile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EtchedPixels%2FLibTile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016594,"owners_count":26085852,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-20T08:40:13.012Z","updated_at":"2025-10-13T18:39:56.834Z","avatar_url":"https://github.com/EtchedPixels.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LibTile\nSome experiments in a portable tile based graphcis library\n\nNothing to see here, just some scribbling\n\n## Concept\n\nA small library that can render tile based graphics on a large number of\noutput targets with some level of efficiency. Also something small enough\nto use on 8bit micros.\n\n## Model\n\nThe display consists of a grid of fixed sized tiles. In most cases these\nwill line up with the physical display, but in other cases they might be\nimposed arbitrarily on a bitmap or similar.\n\nWhy tiles - because they are a common format between a lot of devices. In\naddition because if you need backing store for write only devices, or very\nslow to read back devices, it uses little memory. It also makes some types\nof updating and second level backing store much much more memory efficient.\n\nThe API provides a minimal set of interfaces to manipulate tiles. It allows\nyou to set a tile in the display buffer or optional backbuffer. It also has\nsome optimized paths for setting a group of tiles, and for filling a block\nwith the same tile.\n\nColours are attached to the tile not to the display square. This is a lowest\ncommon denominator thing as some displays embed the colour in the tile\nitself and others group tiles together in blocks with a single colour\nsetting.\n\nTile numbering is done by the library, or more accurately by the output\ndriver. ASCII tiles 32-126 are always the same logical numbering. The other\ntile numbers are assigned by the driver so it can match hardware behaviour,\ncolour grouping rules and so on.\n\n## Tile Formats\n\nTiles end up needing to be available in multiple formats. At the moment the\nlibrary design anticipates the following\n\n- ASCII - a literal mapping of ASCII symbols\n- ANSI - likewise for the ANSI graphic set along with a colour for each tile\n- 8x8 pixels - monochrome bitmap with an attached colour\n- 8x12 pixels - likewise but taller\n- 6x8 pixels - likewise but squashed up (notably for MSX text mode and for things like the 480x320 TFT panels doing 80 column text)\n- RGB332 - PropGFX, some TFT panels and fancier displays\n\nThe tiles (and fonts) are kept in a resource file with a very simple\nstructure so that a program can remain small and portable by loading a\nsuitable resource set.\n\nThe resource API loads a block of tiles from the resource file and assigns\nthem into an array. If there are more tiles than resources then they are\nloaded until the resource is consumed. Tile blocks can be freed and\nallocated but freeing tiles and allocating new ones may or may not change\nthe existing display so this is more relevant to things like theming\nor game level changes.\n\nThe intended use case is an array of ascii fallback symbols which will then\nbe replaced (in part, whole or none) by tile numbers. Thus a program can\nfall back to ASCII or partly ASCII cleanly but also gets enough info if it\nwants to be clever about different tile space limits.\n\n## Output Drivers\n\nExperimenting at the moment:\n- VT100 - ASCII mode (TODO: VT220/3xx downloadable fonts)\n- ANSI - Likewise with colour and more symbols\n- VT52 - Fuzix console (optional UDG TODO)\n- Sixels - because\n\nTo add:\n- Termcap\n- Bitmap in memory space\n- Bitmap with write command\n- SPI/direct attach TFT panels (ILI9341 etc)\n- RCbus Propeller GFX (RGB222)\n\nThere are also some displays that suffer from being weird enough they might\nneed their own special case driver (eg EF9345 quadrichrome)\n\n## Resource Files\n\nThese are a very simple header followed by data blocks. Nothing is\ncompressed currently but the header format doesn't care about that. The\nheader follows a magic number (or will do) and consists of simple series\nof six bytes. Byte 1 is the resource type (0 = EOF) 1 is the resource format\nand 2-5 give the file offset.\n\nTo keep things sane weirder directly convertible formats (like sixel) do\nformat conversion as they load.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetchedpixels%2Flibtile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetchedpixels%2Flibtile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetchedpixels%2Flibtile/lists"}