Code Monkey home page Code Monkey logo

gb_cardputer's Introduction

GB Cardputer

Run GameBoy games on your M5Stack Cardputer!*

Uses Peanut-GB, a super cool project that's basically an entire GameBoy emulator in a single C header!

Warning

This "port" is not polished at all, the code needs major commenting, refactoring and other general cleanup.

Audio also doesn't work, since I just didn't feel like making it work for now lol, though I might addreess that later on

I just cobbled this together between yesterday (17/1/2024) and today just to mess around with the Cardputer a bit.

gb_cardputer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gb_cardputer's Issues

ROM loading issues with larger ROMs

Issue Description

Trying to load ROMs larger than ~200 KBs in size causes a crash before emulation can even start, logging an error in the read_rom_to_ram function before (presumably) the ESP32's crash handler resets the device.

Theories on why this happens

The SD Card API functions (specifically the File.readBytes method) expects a char* (aka int8_t*) as a buffer to write the file data to, but Peanut-GB wants the ROM to be an array of uint8_ts.

Since I'm a bad programmer this was my solution:

// rom data is read to char* readRom
uint8_t *rom = (uint8_t*)readRom;
// return rom to Peanut-GB

I think this somehow breaks when ROMs are too big, where loading the ROM into RAM exceeds the Cardputer's 512 KB of SRAM. At the same time, I only log that message when the read_rom_to_ram function returns NULL, so the function is definitely reaching its end.

I don't really have the time or energy to look into or debug this much since I'm busy with school right now, but since other people seem to be interested in Game Boy emulation on the Cardputer I think this would be a good place for other people (who probably have a better understanding of C than me) to potentially fix this issue.

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.