{"id":42130749,"url":"https://github.com/codemeow/doner","last_synced_at":"2026-01-26T15:34:01.557Z","repository":{"id":208704796,"uuid":"722271156","full_name":"codemeow/doner","owner":"codemeow","description":"Generate tables of coordinates for easing functions.","archived":false,"fork":false,"pushed_at":"2024-05-04T14:23:56.000Z","size":484,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-04T15:31:02.498Z","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":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codemeow.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-22T19:34:51.000Z","updated_at":"2024-05-04T14:20:54.000Z","dependencies_parsed_at":"2023-12-23T04:20:39.058Z","dependency_job_id":"18531df1-28ae-4ea1-880e-270c6371b0b6","html_url":"https://github.com/codemeow/doner","commit_stats":null,"previous_names":["codemeow/doner"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/codemeow/doner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemeow%2Fdoner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemeow%2Fdoner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemeow%2Fdoner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemeow%2Fdoner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemeow","download_url":"https://codeload.github.com/codemeow/doner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemeow%2Fdoner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28781508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-26T15:34:00.872Z","updated_at":"2026-01-26T15:34:01.552Z","avatar_url":"https://github.com/codemeow.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿\n# DONER\nEasing tables generator\n\n![inelastic](readme/output.gif)\n\n## HOW TO USE\n\n### Help\n\n    `-h` or `--help` to print this text\n\n    Ex.:\n        doner --help\n\n### Mode\n\nThis program supports two modes: `graph` mode and `table` mode. The `graph` mode allows to see the resulting table values as a graph in the terminal. The UTF-8 Braille characters will be used so the terminal requires UTF-8 support. This does not apply to the `table` mode to work. See section **Running on Windows** for more information.\n\nGraph also shows Y = 0 line as solid line and Y = 1 as dotted line for convinience. The size of the graph depends on the terminal size or defaults to 80x24 when the terminal size is not available. The graph also includes header with min and max values info.\n\n    `-m` or `--mode` to select mode\n\n        Allowed values:\n\n          \"graph\" for graph mode\n          \"table\" for table mode\n\n        Default value is \"graph\"\n\n    Ex.:\n        doner -m graph\n        doner --mode=table\n\n## GENERAL OPTIONS\nThese options are applicable for all modes\n\n### Easing\n\nEasing functions specify the rate of change of the value over time. In this program the generated function is plotted from 0.0 to 1.0 with the selected level of discretization. The Y values are *usually* 0..1 but some exceptions exist.\n\n    `-e xxx` or `--easy=xxx` to select easing function\n\n        Allowed values:\n\n          \"insine\",    \"inquad\",    \"incubic\",    \"inquart\",      \"inquint\", \n          \"inexpo\",    \"incirc\",    \"inback\",     \"inelastic\",    \"inbounce\",\n          \"outsine\",   \"outquad\",   \"outcubic\",   \"outquart\",     \"outquint\", \n          \"outexpo\",   \"outcirc\",   \"outback\",    \"outelastic\",   \"outbounce\",\n          \"inoutsine\", \"inoutquad\", \"inoutcubic\", \"inoutquart\",   \"inoutquint\", \n          \"inoutexpo\", \"inoutcirc\", \"inoutback\",  \"inoutelastic\", \"inoutbounce\"\n\n        Default value is \"insine\"\n\n    Ex.:\n\n        doner -e outquart\n        doner --easy=inoutquint\n\n### X/Y Mods\n\nThere are two additional submodes for the function - inversion of X or Y values. These are added for the scenario when one needs to reverse the generated values instead of doing it in the processing code.\n\n    `-x xxx` or `--xmod=xxx` to select X modifier in `y = F(x)`\n    `-y xxx` or `--ymod=xxx` to select Y modifier in `y = F(x)`\n\n        Allowed values:\n\n          \"orig\" to keep the original values\n          \"inv\" to invers selected value (multiply by -1)\n\n        Default values are \"orig\"\n\n    Ex.:\n\n        doner -m graph -e inelastic\n        doner -m graph -e inelastic -x orig\n        doner -m graph -e inelastic -y orig\n\n![inelastic](readme/01.png)\n\n        doner -m graph -e inelastic -x inv\n![inelastic](readme/02.png)\n\n        doner -m graph -e inelastic -y inv\n![inelastic](readme/03.png)\n\n        doner -m graph -e inelastic -y inv -x inv\n![inelastic](readme/04.png)\n\n### Overflow\n\nWhen generating output values it is sometimes vital to fit in an interval, defined by limitations of the platform, limitations of the variable type or the DOM element size. There is a way to set these borders in the output. It is highly recommended to set both of the borders at once as the values will overflow on the other size and without set border the overflowed values will be too small or too high.\n\n    `-t xxx` or `--overflow-top=xxx` for the top overflow border\n    `-b xxx` or `--overflow-bottom=xxx` for the bottom overflow border\n\n        Allowed values:\n\n          Anything that could be parsed by libc's `strtod`. Some examples are:\n          \"123.456\", \"1.23456e2\", \"0x453.34p-2\"\n\n        Default values are +MAX_DBL and -MAX_DBL respectively\n\n    Ex.:\n\n        doner -m graph -e inback\n![inelastic](readme/05.png)\n\n        doner -m graph -e inback -t 0.5 -b -0.5\n\n![inelastic](readme/06.png)\n\nSome useful application of this mode is to fit the graph values into limited variable (using the table mode). For example, in NES the X could have values [0..255]. Imagine the following code:\n\n        lda table, x ; Load the value from our generated table\n        clc          ; Clear overflow bit\n        adc start_x  ; Add extracted value to the initial animation position\n        sta player_x ; Write final value to the player X position\n\nAs the screen width is limited by 255 only one byte is provided to store the player position. This leads to the situation when the sum value could be bigger than 255 but will overflow to `N MOD 255`. This can also be used to make animation with negative direction. For example, the `inelastic`:\n\n        doner -m graph -e inelastic\n![inelastic](readme/07.png)\n\nLet's multiplicate the final values by 40 to make it produce values [0..40]:\n\n        doner -m graph -e inelastic -k 40\n![inelastic](readme/08.png)\n\nAs could be seen there are negative values that will prevent the correct convertation to [0..255] limits. Let's apply the borders:\n\n        doner -m graph -e inelastic -k 40 -b 0 -t 255\n![inelastic](readme/09.png)\n\nThus making generated values correctly overflow when summing with some starting position:\n\n        lda table, x ; Load value 250\n        clc\n        adc start_x  ; Add value 40. \n        ; The resulting value will be (250 + 40) % 255 = 34\n        ; On the screen this will look as -6 pixels from the starting point.\n\n### Multiplyer\n\nAs mentioned earlier, the resulting value can be multiplied for the case when it cannot be done (or undesirable) in the executing code. For example for the case when the platform cannot operate with floating values. The assigned value will multiply the input value (`y = F(x * k)`):\n\n    `-k xxx` or `--result-multiplier=xxx`to assign multiplier value\n\n        Allowed values:\n\n          Anything that could be parsed by libc's `strtod`.\n\n        Default value is 1.0\n\n### Addend\n\nIn some cases shifting the resulting value is required. This can be achieved width another option (`y = F (x) + a`) :\n\n    `-a xxx` or `--result-addend=xxx` to assign shifting value\n\n        Allowed values:\n\n          Anything that could be parsed by libc's `strtod`.\n\n        Default value is 0.0\n\n## TABLE OPTIONS\nThese options are specific for the `table` mode.\n\n### Cell formatting\n\nAs the program could be used to generate output for a variety of platforms the output format isn't fixed and could be reassigned to meet the required standard.\n\n    `-f xxx` or `--first-cell-fmt=xxx` to set first cell's format\n    `-c xxx` or `--cell-fmt=xxx` to set middle cells format\n    `-l xxx` or `--last-cell-fmt` to set last cell's format\n\n    If the `-f` or `-l` are omitted, the `-c` formatter will be used instead for\n    corner cases.\n\n        Allowed values:\n\n          Formatter string for `printf`-function family. Some examples are:\n          \"%4d, \", \"%8.0f\", \"%hhu\". The output value will be automatically\n          converted to meet the desired output format. Floating values will\n          be rounded (not truncated).\n\n        Default value values are \"%8.2f \"\n\n    Ex.:\n\n        doner -m table -e inelastic\n```\n    0.00     0.00    -0.00     0.00     0.00     0.00     0.00  \u003c...\u003e\n   -0.01    -0.01    -0.01    -0.01    -0.00    -0.00     0.00  \u003c...\u003e\n   -0.02    -0.02    -0.03    -0.04    -0.05    -0.05    -0.04  \u003c...\u003e\n    0.05     0.05    -0.01    -0.09    -0.18    -0.26    -0.33  \u003c...\u003e\n```\n        doner -m table -e insine -c \"%3hhu \" -k 100\n```\n  0   0   0   0   0   0   1   1   2   2   3   3   4   4   5   6   7 \n  8   8   9  10  11  12  13  15  16  17  19  20  22  23  25  27  28 \n 30  30  32  34  36  38  40  42  44  46  48  50  52  54  57  59  61 \n 63  63  66  68  71  73  75  78  80  83  85  88  90  93  95  98 100 \n```\n        (6502 assembly format)\n        doner -m table -e insine -f \"   .byte $%02x, \" -c \"$%02x, \" -l \"$%02x\" -k 255\n```\n   .byte $00, $00, $00, $00, \u003c...\u003e $0b, $0d, $0f, $12\n   .byte $14, $14, $17, $19, \u003c...\u003e $3c, $40, $44, $48\n   .byte $4d, $4d, $52, $56, \u003c...\u003e $8b, $90, $96, $9c\n   .byte $a2, $a2, $a8, $ae, \u003c...\u003e $ec, $f2, $f9, $ff\n```\n        (C static constant format)\n        doner -m table -e insine -f \"   [ %f, \" -c \"%f, \" -l \"%f ],\"\n```\n   [ 0.000000, 0.000000, 0.000311, \u003c...\u003e 0.052073, 0.060307, 0.069126 ],\n   [ 0.078524, 0.078524, 0.088494, \u003c...\u003e 0.250219, 0.266948, 0.284133 ],\n   [ 0.301763, 0.301763, 0.319827, \u003c...\u003e 0.566116, 0.588713, 0.611565 ],\n   [ 0.634659, 0.634659, 0.657980, \u003c...\u003e 0.950154, 0.975069, 1.000000 ],\n```\n### Table width\n\nFor the convinience the output table width can be adjusted with the following option:\n\n    `-w xxx` or `--table-width=xxx` to set output table width (in elements)\n\n        Allowed values:\n\n          Any possible integer value from 1 to UINT64_MAX\n\n        Default value is 16\n\n    Ex.:\n\n        doner -m table -e insine -w 4\n```\n    0.00     0.00     0.00     0.00     0.00 \n    0.00     0.00     0.01     0.01     0.02 \n    0.02     0.02     0.03     0.03     0.04 \n\u003c...\u003e\n    0.73     0.73     0.75     0.78     0.80 \n    0.83     0.83     0.85     0.88     0.90 \n    0.93     0.93     0.95     0.98     1.00 \n```\n### Table size\n\nBy default the table is produced for 64 values with the loop where input X values are 0..1 with the increment of 1/64. To change this there is an additional option:\n\n    `-s xxx` or `--table-size=xxx`\n\n        Allowed values:\n\n            Any possible integer value from 1 to UINT64_MAX\n\n        Default value is 64\n\n    Ex.:\n\n        doner -m table -e insine -w 4 -s 16\n```\n    0.00     0.00     0.01     0.02     0.05 \n    0.09     0.09     0.13     0.19     0.26 \n    0.33     0.33     0.41     0.50     0.59 \n    0.69     0.69     0.79     0.90     1.00 \n```\n        doner -m table -e insine -w 6 -s 20 -c \"%f, \"\n```\n0.000000, 0.000000, 0.003416, 0.013639, 0.030600, 0.054183, 0.084227, \n0.120526, 0.120526, 0.162834, 0.210859, 0.264276, 0.322718, 0.385787, \n0.453052, 0.453052, 0.524053, 0.598305, 0.675301, 0.754515, 0.835405, \n0.917421, 0.917421, 1.000000,\n```\n\n### Difference\n\nSometimes it is faster to operate with previous value of the cell instead of keeping the original value. In this case this flag could be set to write only difference between previous and current cell.\n\nIn other words:\n```\nOriginal:   [0, 5, 6, 8, 4]\nDifference: [0, (5-0), (6-5), (8-6), (4-8)], thus\n            [0, 5, 1, 2, -4]\n```\n\nMathematically speaking this values are derivative of the function (rate of change of this function). This flag does not affect the `graph` mode.\n\nTop and bottom limits could be also applied here\n\n\n    `-d` or `--difference`\n\n    Ex.:\n\n```\n       doner -m table -e insine -w 4 -s 8\n\n    0.00     0.03     0.10     0.22\n    0.38     0.57     0.78     1.00\n```\n```\n        doner -m table -e insine -d -w 4 -s 8\n\n    0.00     0.03     0.07     0.12\n    0.16     0.19     0.21     0.22\n```\n```\n       doner -m table -e insine -f \"   .byte $%02x, \" -c \"$%02x, \" -l \"$%02x\" -w 4 -s 16 -k 40 -t 255 -b 0\n\n    .byte $00, $00, $01, $02\n    .byte $03, $05, $08, $0a\n    .byte $0d, $10, $14, $18\n    .byte $1c, $20, $24, $28\n```\n```\n       doner -d -m table -e insine -f \"   .byte $%02x, \" -c \"$%02x, \" -l \"$%02x\" -w 4 -s 16 -k 40 -t 255 -b 0\n\n    .byte $00, $00, $01, $01\n    .byte $02, $02, $02, $03\n    .byte $03, $03, $04, $04\n    .byte $04, $04, $04, $04\n```\n\n**Note:**\nBe advised, that in this mode the final point of the object could differ from the last value of the non-diff mode! That happens because of the cumulative rounding error. This cannot be solved easily in the code, as some side effects will present:\n\n* If to remove the `round` call - the 39.999 values will become 39 instead of 40. Thus making final point wrong again\n* If to calc diff between printed values (not the original ones) then the ever-growing function will sometime produce decreasing values. Like in the example above:\n\n```\n00,  00,  01,  02,  03,  05,  08,  10  F(x)\n   0    1    1    1    2    3    2     F(x)'\n      1    0    0    1    1   -1       F(x)\"\n```\nSo it is recommended to check the final point and correct some values manually (changing the 6th value in this case from 3 to 2 for ex.)\n\n## Running on windows\nUnfortunately by default windows `cmd` and `powershell` does not support Braille unicode block. So, the only options are:\n1. Install or set the font that do support it (for ex. \"MS Gothic\", but it has some issues with usual characters).\n![inelastic](readme/windows-cmd.png)\n2. Use \"Windows terminal\" application (from [here](https://apps.microsoft.com/detail/9N0DX20HK701?hl=en-us\u0026gl=US) or [here](https://github.com/microsoft/terminal))\n![inelastic](readme/windows-terminal.png)\n3. Do not use the `graph` mode. The `table` mode works fine in any terminal\n![inelastic](readme/windows-table.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemeow%2Fdoner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemeow%2Fdoner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemeow%2Fdoner/lists"}