{"id":17703276,"url":"https://github.com/visrealm/vremulcd","last_synced_at":"2025-09-05T17:31:25.924Z","repository":{"id":174975292,"uuid":"248428474","full_name":"visrealm/vrEmuLcd","owner":"visrealm","description":"Character LCD emulator library (C99 engine, web front-end).","archived":false,"fork":false,"pushed_at":"2024-07-04T13:49:16.000Z","size":3791,"stargazers_count":71,"open_issues_count":0,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T10:11:41.461Z","etag":null,"topics":["1602-lcd","1602lcd","arduino","c","character-lcd","emscripten","emulator","hd44780","javascript","lcd","lcd-display","lcd-screen","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://cpu.visualrealmsoftware.com/emu/?h=7e387e0f377e010716bd0c7d1042303915fcc22f0d6e48656c6c6f2c20576f726c642100","language":"C","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/visrealm.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":"2020-03-19T06:34:22.000Z","updated_at":"2025-03-22T22:21:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"c983b692-0dff-4939-aaaa-ac39692bc5d3","html_url":"https://github.com/visrealm/vrEmuLcd","commit_stats":{"total_commits":54,"total_committers":4,"mean_commits":13.5,"dds":"0.37037037037037035","last_synced_commit":"9230a227bbf236537e351448bd7f48aae7ff0a52"},"previous_names":["visrealm/vremulcd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/visrealm/vrEmuLcd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visrealm%2FvrEmuLcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visrealm%2FvrEmuLcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visrealm%2FvrEmuLcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visrealm%2FvrEmuLcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/visrealm","download_url":"https://codeload.github.com/visrealm/vrEmuLcd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visrealm%2FvrEmuLcd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273790554,"owners_count":25168674,"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-09-05T02:00:09.113Z","response_time":402,"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":["1602-lcd","1602lcd","arduino","c","character-lcd","emscripten","emulator","hd44780","javascript","lcd","lcd-display","lcd-screen","wasm","webassembly"],"created_at":"2024-10-24T20:22:22.162Z","updated_at":"2025-09-05T17:31:25.253Z","avatar_url":"https://github.com/visrealm.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vrEmuLcd - HD44780 Character LCD Emulator\n\n\u003ca href=\"https://github.com/visrealm/vrEmuLcd/actions/workflows/cmake-multi-platform.yml\"\u003e\u003cimg src=\"https://github.com/visrealm/vrEmuLcd/actions/workflows/cmake-multi-platform.yml/badge.svg\"/\u003e\u003c/a\u003e\n\nCore engine written in C with a flexible Web front-end.\n\nThis Character LCD Emulator can be used to emulate most standard LCD displays.\n\nIt accepts and responds to most commands listed in the [HD44780 datasheet](https://www.sparkfun.com/datasheets/LCD/HD44780.pdf)\n\nIt also now support most commands for a 128x64 graphics LCD [12864B datasheet](https://www.exploreembedded.com/wiki/images/7/77/QC12864B.pdf)\n\n## Screenshots:\n\n#### Hello, World!\n\u003cimg src=\"res/vrEmuLcd.gif\" alt=\"Hello, World!\" width=\"400px\"\u003e\n\n#### Different Colors\n\u003cimg src=\"res/helloworld2.png\" alt=\"Different Colors!\" width=\"400px\"\u003e\n\n#### Different Sizes\n\u003cimg src=\"res/lcd2004_demo.png\" alt=\"Different Sizes!\" width=\"400px\"\u003e\n\n#### 128 x 64 Graphics LCD\n\u003cimg src=\"https://visrealm.github.io/hbc-56/img/glcd_basic.gif\" alt=\"HBC-56 Emulator LCD Window\" width=\"400px\"\u003e\n\n#### Custom characters (CGRAM support)\n\u003cimg src=\"res/the8bitguy.png\" alt=\"Custom characters (CGRAM support)!\" width=\"400px\"\u003e\n\n## Live examples:\n\n* [Hello, World!](https://visrealm.github.io/vrEmuLcd/examples/helloworld)\n* [The 8-Bit Guy: Character LCD](https://visrealm.github.io/vrEmuLcd/examples/8bitguy)\n* [Hello Graphics LCD](https://visrealm.github.io/vrEmuLcd/examples/hellogfx)\n* [Troy's Breadboard Computer!](https://cpu.visualrealmsoftware.com/emu/?h=7e387e0c7e01370730b800b801bdebbdc20f48b1bd7f4e07bd81b805b8061701ba040b4703ccc0b80307b3c050323937c0da392b40b8044f02b1bd7f4f05b1495704ce71bd76b9058a0abd7f4f02bd7f4e4956fa3e61bdd94f0317fddaba022f6c4f06b149bd7f4ebd76b9067ecc4701fc4700fc2f22c107eff83e7e0fbd6ebdabc0b017a4ce0a491730da014eb0ce0a174ace0740d4f0460f07d80f01e039a3cd2f9d010a49d00a88fc6e17f0070fd8da0f0ef83cb7780a17bdb5b5b5cd3fc1c16e7e80078a0f1050fec0e13ec87ec00f0a50fec0e13ed26e4700c00f3af83ee84701c0b8010730b8006e0740f00f0a074ab05182fec0c172fa3ef3566e0000000064000000000000000f08080808080808080808080808080f1f00000000000000000000000000001f1f00000000000000000000000000001f1e02020202020202020202020202021e0f08080808080808080808080808080f1f00000000000000000000000000001f1f00000000000000000000000000001f1e02020202020202020202020202021e2054544c2020000204062053636f7265536e616b6521010305070302011514131211252423222135343340f080ff1010200100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\u0026s=300)\n\n## Usage\n\n### C\n```c\n#define LCD_WIDTH 20\n#define LCD_HEIGHT 4\n\nVrEmuLcd      *lcd = vrEmuLcdNew(LCD_WIDTH, LCD_HEIGHT, EmuLcdRomA00);\n\n// send it commands:\nvrEmuLcdSendCommand(lcd, LCD_CMD_FUNCTION | LCD_CMD_FUNCTION_LCD_2LINE | 0x10);\nvrEmuLcdSendCommand(lcd, LCD_CMD_CLEAR);\nvrEmuLcdSendCommand(lcd, LCD_CMD_HOME);\nvrEmuLcdSendCommand(lcd, LCD_CMD_DISPLAY | LCD_CMD_DISPLAY_ON);\n\n// send it data\nvrEmuLcdWriteByte(lcd, 'H');\nvrEmuLcdWriteByte(lcd, 'e');\nvrEmuLcdWriteByte(lcd, 'l');\nvrEmuLcdWriteByte(lcd, 'l');\nvrEmuLcdWriteByte(lcd, 'o');\n\n// or cheat\nvrEmuLcdWriteString(lcd, \" world!\");\n\n// then periodically, render it. \nvrEmuLcdUpdatePixels(lcd);   // generates a snapshot of the pixels state\n\nfor (int y = 0; y \u003c vrEmuLcdNumPixelsY(lcd); ++y) {\n  for (int x = 0; x \u003c vrEmuLcdNumPixelsX(lcd); ++x) {\n    // do whatever you like with the pixel information. render it to a texture, output it to  a console, whatever\n   // values returned are:  -1 = no pixel (character borders), 0 = pixel off, 1 = pixel on\n    char pixel = vrEmuLcdPixelState(lcd, x, y);\n  }\n}\n```\n\n### Web\n\n#### HTML (local)\n```html\n\u003cscript src=\"src/vrEmuLcd.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"bin/vrEmuLcdWasm.js\"\u003e\u003c/script\u003e\n```\n#### HTML (live)\n```html\n\u003cscript src=\"https://visrealm.github.io/vrEmuLcd/src/vrEmuLcd.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://visrealm.github.io/vrEmuLcd/bin/vrEmuLcdWasm.js\"\u003e\u003c/script\u003e\n```\n    \n## Example\n\n```js\n\u003ccanvas id=\"lcd\"\u003e\u003c/canvas\u003e\n...\n\u003cscript\u003e\n    var canv = document.getElementById('lcd');\n    var ctx = canv.getContext('2d');\n\n    vrEmuLcd.setLoadedCallback(function () {\n\n      // create a new LCD object\n      var lcd = vrEmuLcd.newLCD(16, 2, vrEmuLcd.CharacterRom.Eurpoean);\n\n      // set up the display\n      lcd.sendCommand(LCD_CMD_DISPLAY | LCD_CMD_DISPLAY_ON);\n\n      lcd.writeString(\"Hello, World!\");\n\n      lcd.render(ctx, 0, 0, 800, 400);\n    });\n\u003c/script\u003e\n```\n\n## LCD API\n\n#### constuctor\n```js\nvar lcd = vrEmuLcd.newLCD(columns, rows, charSet);\n```\n- `columns`: - number of columns\n- `rows`: - number of rows\n- `charSet`: - character set. One of: `vrEmuLcd.CharacterRom.European`, `vrEmuLcd.CharacterRom.Japanese`\n\n#### sendCommand(commandByte)\nSend a command to the instruction register of the lcd\nCommand constants are defined:\n- `LCD_CMD_CLEAR` - clear the display\n\n- `LCD_CMD_HOME` - reset display to home position\n\n- `LCD_CMD_ENTRY_MODE` - entry mode (the following to be bitwise-OR'd)\n  - `LCD_CMD_ENTRY_MODE_INCREMENT` - automatically increment the cursor or display\n  - `LCD_CMD_ENTRY_MODE_DECREMENT` - automatically decrement the cursor or display\n  - `LCD_CMD_ENTRY_MODE_SHIFT` - automaticallt shift the entire display instead of the cursor\n\n- `LCD_CMD_DISPLAY` - display mode (the following to be bitwise-OR'd)\n  - `LCD_CMD_DISPLAY_ON` - turn the display on\n  - `LCD_CMD_DISPLAY_CURSOR` - display a cursor (bottom row)\n  - `LCD_CMD_DISPLAY_CURSOR_BLINK` - display a blink cursor (flashing entire character block)\n\n- `LCD_CMD_SHIFT` - move the cursor or scroll display (the following to be bitwise-OR'd)\n  - `LCD_CMD_SHIFT_CURSOR` - shift the cursor (default)\n  - `LCD_CMD_SHIFT_DISPLAY` - shift the display\n  - `LCD_CMD_SHIFT_LEFT` - shift the cursor or display left (default)\n  - `LCD_CMD_SHIFT_RIGHT` - shift the cursor or display right\n\n- `LCD_CMD_SET_CGRAM_ADDR` - set the CGRAM address (actual address uses lower 6 bits)\n\n- `LCD_CMD_SET_DRAM_ADDR` - set the CGRAM address (actual address uses lower 7 bits)\n\n#### writeByte(dataByte)\nWrite a byte to the data register of the lcd\n\n#### writeString(str)\nWrite a string to the data register of the lcd\n\n#### getDataOffset(screenX, screenY)\nReturn the ddram offset for the given screen location\n\n#### readByte()\nRead the current byte from cgram or ddram (determined by current address) \n\n#### readAddress()\nRead the current address offset in cgram or ddram\n\n#### pixelState(pixelX, pixelY)\nReturn the pixel state at the given location\n- `-1` - no pixel (eg. margin)\n- `0` - pixel off\n- `1` - pixel on\n\n#### colorScheme\nSet/get the color scheme. eg:\n```js\nlcd.colorScheme = vrEmuLcd.Schemes.WhiteOnBlue;\n```\nStandard color schemes:\n- `vrEmuLcd.Schemes.WhiteOnBlue` (default)\n- `vrEmuLcd.Schemes.BlackOnBlue`\n- `vrEmuLcd.Schemes.BlackOnGreen`\n- `vrEmuLcd.Schemes.RedOnBlack`\n- `vrEmuLcd.Schemes.BlueOnBlack`\n\nor, provide your own. `{ BackColor: \u003cbackcolor\u003e, PixelOnColor: \u003cpixeloncolor\u003e, PixelOffColor: \u003cpixeloffcolor\u003e }`\n\n#### render(ctx, x, y, width, height)\nRender to a 2d canvas context\n- `ctx` - the canvas to render to\n\n## License\nThis code is licensed under the [MIT](https://opensource.org/licenses/MIT \"MIT\") license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisrealm%2Fvremulcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvisrealm%2Fvremulcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisrealm%2Fvremulcd/lists"}