MCPcopy Index your code
hub / github.com/EmulatorJS/EmulatorJS / getState

Method getState

data/src/GameManager.js:187–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

185 this.functions.restart();
186 }
187 getState() {
188 const state = this.functions.saveStateInfo().split("|");
189 if (state[2] !== "1") {
190 console.error(state[0]);
191 throw new Error(state[0]);
192 }
193 const size = parseInt(state[0]);
194 const dataStart = parseInt(state[1]);
195 const data = this.Module.HEAPU8.subarray(dataStart, dataStart + size);
196 return new Uint8Array(data);
197 }
198 loadState(state) {
199 try {
200 this.FS.unlink("game.state");

Callers 3

quickSaveMethod · 0.95
createBottomMenuBarMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected