<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniil Mira</title>
    <description>The latest articles on DEV Community by Daniil Mira (@zazpro).</description>
    <link>https://dev.to/zazpro</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F391172%2F82d11984-0a0f-4c56-8485-76c537e4edd8.jpeg</url>
      <title>DEV Community: Daniil Mira</title>
      <link>https://dev.to/zazpro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zazpro"/>
    <language>en</language>
    <item>
      <title>C# Chip-8 Emulator (Interpretator)</title>
      <dc:creator>Daniil Mira</dc:creator>
      <pubDate>Wed, 20 May 2020 19:34:18 +0000</pubDate>
      <link>https://dev.to/zazpro/c-chip-8-emulator-interpretator-3dd8</link>
      <guid>https://dev.to/zazpro/c-chip-8-emulator-interpretator-3dd8</guid>
      <description>&lt;h2&gt;
  
  
  Some words about Chip-8
&lt;/h2&gt;

&lt;p&gt;Chip-8 is an interpreted programming language that runs on a virtual machine. It was first used in the mid-1970s on a 8 bit computer (as you can guess from the name).&lt;/p&gt;

&lt;h2&gt;
  
  
  Why to do it?
&lt;/h2&gt;

&lt;p&gt;Chip-8 virtual machine and language are relatively simple and it is a very good starting point for getting into emulation in general.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to do it?
&lt;/h2&gt;

&lt;p&gt;Now as we decided why to do it. I want to share some links that got me inspired and helped a lot during the development of this project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/" rel="noopener noreferrer"&gt;How to write an emulator (CHIP-8 interpreter)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://devernay.free.fr/hacks/chip8/C8TECH10.HTM" rel="noopener noreferrer"&gt;Cowgod's Chip-8 Technical Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/CHIP-8#Virtual_machine_description" rel="noopener noreferrer"&gt;CHIP-8 - Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://web.archive.org/web/20150227183132/http://bobpowell.net/lockingbits.aspx" rel="noopener noreferrer"&gt;Using the LockBits method to access image data&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  C#
&lt;/h2&gt;

&lt;p&gt;C# is definitely my favorite OOP language. As a way to get some more advanced practice for this language, this kind of project was chosen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some problems that you might encounter
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Different specifications of the instructions from different sources.&lt;/li&gt;
&lt;li&gt;Slow image render without using any graphics framework.&lt;/li&gt;
&lt;li&gt;A very long main switch loop. (Can be solved by using function pointers)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Ways to solve them
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Different specifications: Can be solved just by simple testing of both different variants.&lt;/li&gt;
&lt;li&gt;Slow image render: Can be solved by modifying image bits directly using pointers.&lt;/li&gt;
&lt;li&gt;Long main switch loop: Switch loop can be substituted by a function pointers but in C# that my be not the fancies solution. Anyway I stuck to this solution at least for learning purpose.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Download link
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/ZAZPRO/Chip8/releases" rel="noopener noreferrer"&gt;GitHub Releases&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Source code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/ZAZPRO/Chip8/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>emulator</category>
      <category>chip8</category>
    </item>
  </channel>
</rss>
