Code Monkey home page Code Monkey logo

Comments (3)

foopod avatar foopod commented on August 24, 2024

Trying to load ROMs larger than ~200 MBs

Do you mean >200kb?

I think the 512kb SRAM could potentially be a hard limit here. Maybe we could look at moving the cart to the flash memory on load and use it from there, but I'm not sure how that would impact performance.

It also looks like there are some minor things we could tweak to hopefully allow loading of 256kb roms. For example it looks like we are using a framebuffer for the full resolution of the cardputer, but a decent chunk isn't used due to the aspect ratio.

from gb_cardputer.

matthew-5pl avatar matthew-5pl commented on August 24, 2024

Oops! Yeah I meant KB, my bad

Addressing a few things here:

  • AFAIK excluding some bigger ROMs which can be around ~2MB, the Cardputer's 512KB of RAM should be more than enough for most games + the Game Boy's 8KB of RAM and the two framebuffers (I'll expand on why I'm using two framebuffers later, but now that you mentioned it I should really think of a better way to implement that)
  • Writing to flash might be a good idea, but it would probably be better to implement some sort of "chunking" system to reduce read times which would probably require some more in-depth knowledge on the Game Boy's architecture and possibly some edits to the Peanut-GB code. AFAIK the reason the Game Boy could handle such big ROMs despite its RAM size is because it had a dedicated bus to the cartridge, which it could use to request an address and get the corresponding data back from ROM quickly. With the ESP32 we might not be able to do something like that.
  • The reason I'm using two framebuffers (the standard Peanut-GB one and another one called swap_fb) is to be able to quickly draw frames to the screen. When I first got the emulator to work I remember it getting to the Tetris copyright screen and then seemingly just freezing there. However, I did some experiments and figured out that the Cardputer's display refreshes a Game Boy frame pretty slowly, so I added another framebuffer which I write into after every frame draw and then check when the next frame is ready to only redraw the pixels that changed. Without this the emulator is unusable, so unusable that getting past that Tetris copyright screen took around 5 minutes when it should take a few seconds.
  • As for the size of the framebuffer, I'm afraid I can't do much about that as Peanut-GB expects a framebuffer of that size and trying to change that would cause a segfault. Again, this might be fixed by editing the Peanut-GB code but I don't think it's worth it for what should be a few hundred bytes of extra memory.

With that said thanks for your interest! Sadly as I've already said in this reddit post I won't really be able to get to trying any of this right now as I'm pretty busy with school :(

from gb_cardputer.

matthew-5pl avatar matthew-5pl commented on August 24, 2024

Also please do correct me if I'm wrong with any of what I wrote, I'm definitely not an expert here and I'd love to learn more lol

from gb_cardputer.

Related Issues (1)

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.