Find a way to efficiently scale wasm memory
As suggested by ISSOtm:
Possible allocation strategy :
- Allocate one page
- Dump ROM0 and ROM1, which always exist, in the first 32kB
- Check cart header
- Grow() accordingly, and dump ROM
- Grow() by one page for the rest of the memory (2 pages if it turns out more is needed, though) (Btw, 1 page spans 4 ROM banks)
After referencing the Wasmboy memory map
Currently, the Memory is estimated to be about 9MB, which isn't much of a problem, because apparently the cap on wasm memory is 2 gigabytes
Honestly, if we throw the cartridge at the end of the memory map, then we can scale suuuuppeerrr easy. May want to do that, since the memory map already differs quite a but anyways, and won't require any more work from out memory mapps to find where everything else (Gameboy internals and Sprite map) should be based on the current bank
Updated Memory map accordingly in Wasmboy Memory Map Google Doc
See #50 for possible implmeentations