<?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>Forem: delapise</title>
    <description>The latest articles on Forem by delapise (@xiaodong_wang_0ec85fa0ab7).</description>
    <link>https://forem.com/xiaodong_wang_0ec85fa0ab7</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%2F3903845%2F68e556f7-4118-4800-b1b5-fd4e80c3dafe.jpg</url>
      <title>Forem: delapise</title>
      <link>https://forem.com/xiaodong_wang_0ec85fa0ab7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/xiaodong_wang_0ec85fa0ab7"/>
    <language>en</language>
    <item>
      <title>Building a Retro Game Platform with EmulatorJS &amp; Next.js</title>
      <dc:creator>delapise</dc:creator>
      <pubDate>Wed, 29 Apr 2026 08:10:30 +0000</pubDate>
      <link>https://forem.com/xiaodong_wang_0ec85fa0ab7/building-a-retro-game-platform-with-emulatorjs-nextjs-27pj</link>
      <guid>https://forem.com/xiaodong_wang_0ec85fa0ab7/building-a-retro-game-platform-with-emulatorjs-nextjs-27pj</guid>
      <description>&lt;h1&gt;
  
  
  🎮 Building a High-Performance Retro Game Platform with EmulatorJS
&lt;/h1&gt;

&lt;p&gt;Hey everyone! 👋&lt;/p&gt;

&lt;p&gt;I recently launched a retro gaming platform, &lt;strong&gt;&lt;a href="https://playeretro.com" rel="noopener noreferrer"&gt;playeretro.com&lt;/a&gt;&lt;/strong&gt;, built entirely on top of &lt;strong&gt;EmulatorJS&lt;/strong&gt;. I wanted to share my experience, some technical optimizations I've discovered, and how we managed to get smooth 60FPS gameplay for classics like &lt;em&gt;The King of Fighters 97&lt;/em&gt; directly in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why EmulatorJS?
&lt;/h2&gt;

&lt;p&gt;We chose EmulatorJS for several reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Broad System Support&lt;/strong&gt;: It handles NES, SNES, GBA, N64, and more with a unified interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WebAssembly Performance&lt;/strong&gt;: The core is incredibly fast, even on lower-end devices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customization&lt;/strong&gt;: The API allows for deep integration with modern web frameworks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🚀 Technical Optimizations (Lessons Learned)
&lt;/h2&gt;

&lt;p&gt;During the development of playeretro.com, we ran into a few bottlenecks. Here is what worked for us:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Lazy Loading Cores
&lt;/h3&gt;

&lt;p&gt;Instead of loading all emulator cores at startup, we dynamically import the specific &lt;code&gt;.wasm&lt;/code&gt; core only when a user selects a game. This reduced our initial bundle size by &lt;strong&gt;60%&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Pre-caching BIOS &amp;amp; Assets
&lt;/h3&gt;

&lt;p&gt;We used Service Workers to cache common BIOS files and game metadata. This ensures that returning users see a near-instant load time.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. CDN for ROMs
&lt;/h3&gt;

&lt;p&gt;Hosting ROMs on a high-speed CDN (we use Cloudflare) is critical. EmulatorJS streams the data efficiently, but latency is the enemy of emulation.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ Integration Example
&lt;/h2&gt;

&lt;p&gt;Here is a simplified snippet of how we initialize the emulator:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
const EJS_player = document.getElementById('game-screen');
const config = {
    "id": "game-screen",
    "system": "nes",
    "gameUrl": "/path/to/game.rom",
    "core": "fceumm",
    "background": "#000000"
};
// EmulatorJS auto-init or manual init depending on version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>gamedev</category>
      <category>nextjs</category>
      <category>performance</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
