Giter Site home page Giter Site logo

umairayub79 / chip-8js Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 52 KB

A CHIP-8 Emulator written using JavaScript

Home Page: https://chip-8js.netlify.com/

HTML 15.55% JavaScript 78.41% CSS 6.04%
emulator chip-8-emulator chip-8-interpreter javascript

chip-8js's Introduction

๐Ÿ’ซ About Me:

  • ๐ŸŒฑ Iโ€™m a learner and I try to learn something new everyday
  • ๐Ÿ‘ฏ Iโ€™m looking to collaborate with other developers
  • ๐Ÿฅ… 2023 Goals: Contribute more to Open Source projects

๐Ÿ’ป Tech Stack:

CSS3 HTML5 Java JavaScript Kotlin Python Netlify Heroku Bootstrap Electron.js Express.js NPM NodeJS ANDROID React TailwindCSS SQLite MySQL LINUX

๐Ÿ“Š GitHub Stats:



๐Ÿ† GitHub Trophies

chip-8js's People

Contributors

umairayub79 avatar

Watchers

 avatar

chip-8js's Issues

Code review

Hey, you asked for a code review, I'll go through your code and review it in this issue. I'll start with chip8.js.

Your entire time measuring system is broken:

function step() {
    now = Date.now()
    elapsed = now - then
    if (elapsed > fpsInterval) {
        cpu.cycle()
    }

    loop = requestAnimationFrame(step)
}

You never re-assign then, so the condition is always true, so first of all you might as well do this:

function step() {
    cpu.cycle()
    loop = requestAnimationFrame(step)
}

This is actually already a slight improvement on your code, and since browsers will typically run requestAnimationFrame 60 times per second, it works just fine for display. You already do multiple clock cycles in one cycle() call anyway with this.speed in the CPU, so the actual CPU speed isn't locked by this change.

That's all I have to say about timing, I'll do more in another comment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.