{"id":18370299,"url":"https://github.com/travispaul/mlcd","last_synced_at":"2025-04-10T21:24:46.864Z","repository":{"id":152413819,"uuid":"75682105","full_name":"travispaul/mlcd","owner":"travispaul","description":"Utility for drawing to a Dreamcast Visual Memory Unit's LCD (Maple LCD)","archived":false,"fork":false,"pushed_at":"2019-02-09T13:18:48.000Z","size":144,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-06T12:04:09.087Z","etag":null,"topics":["dreamcast","netbsd","vmu"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/travispaul.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":"2016-12-06T01:27:24.000Z","updated_at":"2023-03-05T12:24:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"e54eb4e3-a08b-4387-b24c-8ac35c315b64","html_url":"https://github.com/travispaul/mlcd","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/travispaul%2Fmlcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travispaul%2Fmlcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travispaul%2Fmlcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travispaul%2Fmlcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/travispaul","download_url":"https://codeload.github.com/travispaul/mlcd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248299675,"owners_count":21080590,"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":["dreamcast","netbsd","vmu"],"created_at":"2024-11-05T23:38:25.805Z","updated_at":"2025-04-10T21:24:46.842Z","avatar_url":"https://github.com/travispaul.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mlcd\n\nCommand line utility and Lua module for drawing graphics to a Dreamcast Visual Memory Unit's LCD (Maple LCD).\n\n## Usage\n\nTo draw to the first VMU LCD connected to the system:\n```\n$ mlcd -d img.bmp \u003e /dev/mlcd0.0\n```\n\nSee [test/example.lua](test/example.lua) for using the lua module.\n\n```lua\n-- Draw a point moving through the center of the display\nlocal mlcd = require 'mlcd'\nlocal x = 0\nmlcd.draw(\"/dev/mlcd0.0\", function ()\n        mlcd.clear()\n        mlcd.point(x, mlcd.HEIGHT / 2)\n        x = x + 1\n        if x == mlcd.WIDTH then\n                x = 0\n        end\nend)\n```\n\nTo run from the command line:\n```\n$ lua example.lua\n```\n\n## Examples\n\n![MLCD](test/mlcd.bmp)\n![MLCD](test/example.bmp)\n\n### ``-b`` ASCII binary \nPrints a \"#\" or \" \" for each pixel, useful for previewing files.\n\n```\n$ mlcd -b mlcd.bmp\n                                 #########\n                             #################\n                          ##########\n                       ##########\n  ##               ###########\n# #####        ##############     #######\n#  ########################################\n # ################################\n #  ############################\n  # ##########################\n  #  #######################\n   # #####################\n   #  ##################\n    #  ###############\n    #  ###########\n     #  #######\n     #\n      #\n      #\n       #    #   #        #   ####   ###  ###\n       #    ##  #  ###  ###  #   # #     #  #\n        #   ### # #   #  #   ####   ###  #   #\n        #   # ### #####  #   #   #     # #   #\n         #  #  ## #      #   #   # #   # #   #\n         #  #   #  ###    ## ####   ###  ####\n          #\n          #\n           #\n           #\n            #\n            #\n```\n\n### ``-c`` C code\nCan be used to replace the default boot image in the [mlcd](https://nxr.netbsd.org/xref/src/sys/arch/dreamcast/dev/maple/mlcd.c#190) NetBSD driver.\n\n```\n$ mlcd -c mlcd.bmp\nstatic const char initimg48x32[192] = {\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0,\n0x00, 0x00, 0x00, 0x07, 0xff, 0xfc,\n0x00, 0x00, 0x00, 0x3f, 0xf0, 0x00,\n0x00, 0x00, 0x01, 0xff, 0x80, 0x00,\n0x30, 0x00, 0x1f, 0xfc, 0x00, 0x00,\n0xbe, 0x01, 0xff, 0xf8, 0x3f, 0x80,\n0x9f, 0xff, 0xff, 0xff, 0xff, 0xe0,\n0x5f, 0xff, 0xff, 0xff, 0xe0, 0x00,\n0x4f, 0xff, 0xff, 0xff, 0x00, 0x00,\n0x2f, 0xff, 0xff, 0xfc, 0x00, 0x00,\n0x27, 0xff, 0xff, 0xf0, 0x00, 0x00,\n0x17, 0xff, 0xff, 0xc0, 0x00, 0x00,\n0x13, 0xff, 0xff, 0x00, 0x00, 0x00,\n0x09, 0xff, 0xfc, 0x00, 0x00, 0x00,\n0x09, 0xff, 0xc0, 0x00, 0x00, 0x00,\n0x04, 0xfe, 0x00, 0x00, 0x00, 0x00,\n0x04, 0x00, 0x00, 0x00, 0x00, 0x00,\n0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\n0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\n0x01, 0x08, 0x80, 0x47, 0x8e, 0x70,\n0x01, 0x0c, 0x9c, 0xe4, 0x50, 0x48,\n0x00, 0x8e, 0xa2, 0x47, 0x8e, 0x44,\n0x00, 0x8b, 0xbe, 0x44, 0x41, 0x44,\n0x00, 0x49, 0xa0, 0x44, 0x51, 0x44,\n0x00, 0x48, 0x9c, 0x37, 0x8e, 0x78,\n0x00, 0x20, 0x00, 0x00, 0x00, 0x00,\n0x00, 0x20, 0x00, 0x00, 0x00, 0x00,\n0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\n0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\n0x00, 0x08, 0x00, 0x00, 0x00, 0x00,\n0x00, 0x08, 0x00, 0x00, 0x00, 0x00\n};\n```\n\n### ``-a`` aslc86k\nPrint [aslc86k](http://mc.pp.se/dc/sw.html) code that can be used in VMU games.\n\n```\n$ mlcd -a mlcd.bmp\n.byte %00000000,%00000000,%00000000,%00000000,%00000000,%00000000\n.byte %00000000,%00000000,%00000000,%00000000,%01111111,%11000000\n.byte %00000000,%00000000,%00000000,%00000111,%11111111,%11111100\n.byte %00000000,%00000000,%00000000,%00111111,%11110000,%00000000\n.byte %00000000,%00000000,%00000001,%11111111,%10000000,%00000000\n.byte %00110000,%00000000,%00011111,%11111100,%00000000,%00000000\n.byte %10111110,%00000001,%11111111,%11111000,%00111111,%10000000\n.byte %10011111,%11111111,%11111111,%11111111,%11111111,%11100000\n.byte %01011111,%11111111,%11111111,%11111111,%11100000,%00000000\n.byte %01001111,%11111111,%11111111,%11111111,%00000000,%00000000\n.byte %00101111,%11111111,%11111111,%11111100,%00000000,%00000000\n.byte %00100111,%11111111,%11111111,%11110000,%00000000,%00000000\n.byte %00010111,%11111111,%11111111,%11000000,%00000000,%00000000\n.byte %00010011,%11111111,%11111111,%00000000,%00000000,%00000000\n.byte %00001001,%11111111,%11111100,%00000000,%00000000,%00000000\n.byte %00001001,%11111111,%11000000,%00000000,%00000000,%00000000\n.byte %00000100,%11111110,%00000000,%00000000,%00000000,%00000000\n.byte %00000100,%00000000,%00000000,%00000000,%00000000,%00000000\n.byte %00000010,%00000000,%00000000,%00000000,%00000000,%00000000\n.byte %00000010,%00000000,%00000000,%00000000,%00000000,%00000000\n.byte %00000001,%00001000,%10000000,%01000111,%10001110,%01110000\n.byte %00000001,%00001100,%10011100,%11100100,%01010000,%01001000\n.byte %00000000,%10001110,%10100010,%01000111,%10001110,%01000100\n.byte %00000000,%10001011,%10111110,%01000100,%01000001,%01000100\n.byte %00000000,%01001001,%10100000,%01000100,%01010001,%01000100\n.byte %00000000,%01001000,%10011100,%00110111,%10001110,%01111000\n.byte %00000000,%00100000,%00000000,%00000000,%00000000,%00000000\n.byte %00000000,%00100000,%00000000,%00000000,%00000000,%00000000\n.byte %00000000,%00010000,%00000000,%00000000,%00000000,%00000000\n.byte %00000000,%00010000,%00000000,%00000000,%00000000,%00000000\n.byte %00000000,%00001000,%00000000,%00000000,%00000000,%00000000\n.byte %00000000,%00001000,%00000000,%00000000,%00000000,%00000000\n```\n\n### Tips and Tricks\n\n#### Clear screen\n```\n$ dd if=/dev/zero of=/dev/mlcd0.0 count=192\n```\n\n#### Draw random pixels\n```\n$ dd if=/dev/urandom of=/dev/mlcd0.0 count=192\n```\n\n#### Cross compile on NetBSD\nYou can build the tools using [build.sh](https://www.netbsd.org/docs/guide/en/chap-build.html#chap-build-tools).\n```\n$ /path/to/tools/bin/nbmake-dreamcast \n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravispaul%2Fmlcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftravispaul%2Fmlcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravispaul%2Fmlcd/lists"}