{"id":28328363,"url":"https://github.com/arlorean/casper","last_synced_at":"2025-10-24T01:52:54.957Z","repository":{"id":145635185,"uuid":"177858595","full_name":"Arlorean/Casper","owner":"Arlorean","description":"ZX Spectrum Emulator for C# Blazor WebAssembly","archived":false,"fork":false,"pushed_at":"2025-07-01T19:49:24.000Z","size":5369,"stargazers_count":18,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-11T00:52:59.388Z","etag":null,"topics":["blazor","blazor-client","blazor-server","blazor-webassembly","emulator","game","retro","retrogaming","webassembly","zx-spectrum-emulator"],"latest_commit_sha":null,"homepage":"","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/Arlorean.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}},"created_at":"2019-03-26T19:50:51.000Z","updated_at":"2025-07-25T04:50:04.000Z","dependencies_parsed_at":"2024-02-16T23:12:44.458Z","dependency_job_id":"f4fd87fb-c0d1-4ea5-add3-6cf88bfbf768","html_url":"https://github.com/Arlorean/Casper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Arlorean/Casper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arlorean%2FCasper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arlorean%2FCasper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arlorean%2FCasper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arlorean%2FCasper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arlorean","download_url":"https://codeload.github.com/Arlorean/Casper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arlorean%2FCasper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280723933,"owners_count":26380108,"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-23T02:00:06.710Z","response_time":142,"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":["blazor","blazor-client","blazor-server","blazor-webassembly","emulator","game","retro","retrogaming","webassembly","zx-spectrum-emulator"],"created_at":"2025-05-26T06:16:50.383Z","updated_at":"2025-10-24T01:52:54.952Z","avatar_url":"https://github.com/Arlorean.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Casper\n**C# ZX Spectrum Emulator**\n\nThis project is a C# port of [Jasper](https://github.com/Arlorean/Jasper) (Java Spectrum Emulator)\nfor .NET Standard (2.0.3), Windows Forms (on .NET Framework 4.6.1),\nand now [Blazor Server-side](https://docs.microsoft.com/en-gb/aspnet/core/blazor/hosting-models#blazor-webassembly)\n and [Blazor Client-side](https://docs.microsoft.com/en-gb/aspnet/core/blazor/hosting-models#blazor-server) (using WebAssembly)\non [.NET Core 3.1](https://devblogs.microsoft.com/dotnet/announcing-net-core-3-1/).\n\n![Manic Miner](docs/ManicMiner-BlazorServer.png)\n\n## How to Build\n\nDownload or fork this repository and open the `Casper.sln` file in Visual Studio 2019 (version 16.5.4 or above).\nYou will need to have the following [workloads](https://visualstudio.microsoft.com/vs/#workloads) installed\nusing the [Visual Studio Installer](https://docs.microsoft.com/en-us/visualstudio/install/modify-visual-studio?view=vs-2019#modify-workloads):\n- ASP.NET and web development\n- .NET desktop development\n\n## How to Run\n\nIn Visual Studio, set one of the following projects to be your startup project and **press F5** to start debugging:\n- Casper.BlazorServer\n- Casper.BlazerWebAssembly\n- Casper.Forms\n\n## How to Play Manic Miner\n\n1. Click in the window to get keyboard focus.\n2. Press Enter when the Manic Miner text starts to flash.\n3. Press Enter to start the game. \n4. Collect all the pulsating keys and head to the exit for each level.\n\n| Key               | Action |\n|:-------------------:|--------|\n|![](docs/keys/KeyQ.svg) | Left   |\n|![](docs/keys/KeyW.svg) | Right   |\n|![](docs/keys/KeySPACE.svg) | Jump   |\n\n\n\n## How to Install\n\nThe BlazorWebAssembly project is setup as a Progressive Web App (PWA) so you should see a **(+)** sign appear in the address \nbar in your browser, indicating that you can install it locally as a desktop app.\n\n![](docs/ManicMiner-BlazorWebAssembly-InstallApp.png)\n\nFor now there is no installer for Windows Forms or Blazor Server side.\n\n## The Spectrum Keyboard\n\nThe original 16Kb/48Kb ZX Spectrum had a rubber keyboard and the BASIC language keywords were entered using\na combination of keys. Later keyboards weren't rubber but still retained the keyword tokens\nuntil finally the 128Kb ZX Spectrum allowed for free form text entry, after which is tokenized\nthe BASIC keywords again. Here is the layout of the original model:\n\n![](docs/zxspectrum_keyboard.svg)\n\n## History\n\nIn **1982** the hugely popular home computer the [Sinclair ZX Spectrum](https://en.wikipedia.org/wiki/ZX_Spectrum) \nwas created by [Clive Sinclair](https://en.wikipedia.org/wiki/Clive_Sinclair).\nIt seeded a generation of software developers and I owe my entire career\nto that one purchasing decision made for me when I was 12 years old. Thanks Mum!\n\nIn **1989** my friend [Andrew Pollard](https://www.linkedin.com/in/andrew-pollard-507ab114/)\ncreated this emulator in [Motorola 68000](https://en.wikipedia.org/wiki/Motorola_68000)\nassembly code in order to play [Steve Davis Snooker](https://www.worldofspectrum.org/infoseekid.cgi?id=0004896)\non his [Atari ST](https://en.wikipedia.org/wiki/Atari_ST) because he was disappointed in the \n[Atari ST version](https://en.wikipedia.org/wiki/Steve_Davis_World_Snooker).\n\nIn **1992** Andrew ported the emulator to C code and we then ported it to [X Windows](https://en.wikipedia.org/wiki/X_Window_System) \nso we could play [Match Day](https://www.worldofspectrum.org/infoseekid.cgi?id=0003067) where\neach of us played on our own [Sun SparcStation](https://en.wikipedia.org/wiki/SPARCstation_1)\nwith the emulator essentially running as a back-end server.\n\nIn **1996** Sun released their first version of the Java Develop Kit with the tag line *write once, run anywhere*.\nI was completely sold, especially when I saw their Web Browser implementation\n[HotJava](https://en.wikipedia.org/wiki/HotJava) written 100% in Java\nwith a new [Java Applet](https://en.wikipedia.org/wiki/Java_applet) model\nfor running Java content inside a Web Browser.\nI could see that we could resurrect the emulator and port it to Java.\nYes it would be slow, since the Java Bytecode was interpreted,\nbut Just-in-Time (JIT) compilation was coming and I knew I couldn't wait.\n\nIn **1997** during the [browser wars](https://en.wikipedia.org/wiki/Browser_wars) Netscape and Internet Explorer \nwere both vying to be the best Web Browser on the market and Java Applet performance\nwas a differentiator for them. They both came our with JIT support for Java Applets around the same\ntime and suddenly the Java Spectrum Emulator (Jasper) got a new lease of life. \nWith JIT it ran in real-time on a 133Mhz Pentium in 16Mb RAM. We even got some\ninterest from the press, [Internet Magazine](https://en.wikipedia.org/wiki/Internet_Magazine) \nran an article on [our website](https://web.archive.org/web/19980210232053/http://www.spectrum.lovely.net/) in March 1997:\n\n![](docs/InternetMagazine-March1997-Article.jpg)\n\nIn **2019** in a bid to learn about Blazor I decided to resurrect the old emulator\ncode again and port it to C#. I did a Windows Forms reference first so I could \nmake sure things were working as they should be. Then I moved on to the Blazor\nversion. I could see the same story of interpreted byte code initially with the\npromise of JIT or AOT (Ahead-of-Time) compilation hopefully making the \nBlazor WebAssembly version run in real-time once again.\n\nI hit a roadblock straight away. The promise of Blazor was that you \ndidn't have to write JavaScript, you could create an app, in the browser, \nwith just C# code. However I couldn't see how to write a canvas object in C#\nwithout all the messy [JavaScript interop](https://docs.microsoft.com/en-us/aspnet/core/blazor/call-javascript-from-dotnet)\nwhich I really didn't want to deal with.\n\nIn **2020**, [Coronavirus](https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic)\nlock-down has given us a lot of time for fun projects so I thought I'd revisit this one.\nBlazor (or [Razor](https://docs.microsoft.com/en-us/aspnet/core/razor-pages))\nis all about DOM manipulation but the [HTML Canvas](https://www.w3schools.com/html/html5_canvas.asp)\ndoesn't have a DOM, it's all immediate.\nHowever I realized that HTML Scalable Vector Graphics ([SVG](https://www.w3schools.com/html/html5_svg.asp))\n does and so I set about creating a Blazor SVG version of the ZX Spectrum Emulator. Crazy, right?!\n\n## Credits\n\n[Andrew Pollard](https://www.linkedin.com/in/andrew-pollard-507ab114/) who created the\noriginal emulator code and painstakingly went through each [Z80 Mnemonic](http://www.worldofspectrum.org/z88forever/dn327/z80inst2.htm) checking\nthat they functioned as they did in the original [Zilog Z80](https://en.wikipedia.org/wiki/Zilog_Z80).\n\n[Amstrad](https://en.wikipedia.org/wiki/Amstrad) who now own the ZX Spectrum brand are the owners of the\n[Spectrum.rom](Casper.Shared/Resources/Spectrum.rom) file, which is a copy of the original ZX Spectrum 16K ROM code.\nIn [a post on comp.sys.sinclair](https://www.worldofspectrum.org/permits/amstrad-roms.txt) they requested \nthis notice be attached whenever their ROM files were redistributed:\n\u003e *Amstrad have kindly given their permission for the redistribution of their copyrighted material but retain that copyright*\n\nThe font used on the web page is the [ZX82 System Font](http://www.type-invaders.com/sinclair/zx82system/)\nby [Paul van der Laan](http://www.type-invaders.com/sinclair/).\n\nThe [Keyboard SVG](docs/zxspectrum_keyboard.svg) was derived from a [PowerPoint of the ZX Spectrum Keyboard](https://softspectrum48.weebly.com/uploads/6/6/7/5/66753101/zx_keyboard.pptx)\nby [Magnus Krook](https://softspectrum48.weebly.com/).\n\nThe [Manic Miner](Casper.Shared/Resources/Games/ManicMiner.z80) game was \nwritten by [Matthew Smith](https://en.wikipedia.org/wiki/Matthew_Smith_(games_programmer)) \nand published by [Bug Byte Software Limited](https://www.worldofspectrum.org/infoseekid.cgi?id=0003012) in 1983.\n\n**NOTE:** The *Manic Miner* game is **not** covered by the MIT license.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farlorean%2Fcasper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farlorean%2Fcasper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farlorean%2Fcasper/lists"}