torch2424 / wasmboy

Game Boy / Game Boy Color Emulator Library, 🎮written for WebAssembly using AssemblyScript. 🚀Demos built with Preact and Svelte. ⚛️
https://wasmboy.app/
GNU General Public License v3.0
1.39k stars 65 forks source link

Wasmboy Game Sav RAM and Save States #14

Closed torch2424 closed 6 years ago

torch2424 commented 6 years ago

Identify Gameboy games and rooms by their header (either titles or checksums)

http://gbdev.gg8.se/wiki/articles/Gameboy_ROM_Header_Info

https://www.google.com/amp/s/amp.reddit.com/r/EmuDev/comments/6bettn/list_of_all_gbgbc_rom_cartridge_information_with/

Read that catridge ram is battery powered. May just want to save the catridge ram in memory. Which equates to about 50 games of ram being able to be saved in memory :)

http://gbdev.gg8.se/wiki/articles/Memory_Bank_Controllers#A000-BFFF_-_RAM_Bank_00-03.2C_if_any_.28Read.2FWrite.29

https://developers.google.com/web/fundamentals/instant-and-offline/web-storage/offline-for-pwa

https://developers.google.com/web/fundamentals/app-install-banners/

Ionic handles app resources caching we just gotta save save files again pico deploy style with idb-keyval, which supports saving arrays and objects :)

https://www.google.com/amp/s/blog.ionicframework.com/how-to-make-pwas-with-ionic/amp/

torch2424 commented 6 years ago

Confirmed on discord:

To save In-game save data, simply need to store the cartridge ram.

To make save states, need to save the state of the emulator, for use this includes all non-cartridge ROM data on the gameboy memory map, and we will need to make a function for exporting and importing the state of all internal registers on our classes from memory.

torch2424 commented 6 years ago

https://github.com/torch2424/wasmBoy/pull/24