@thenick775/mgba-wasm 2.6.0-beta.3 → 2.6.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -155,6 +155,13 @@ Callbacks and core settings:
155
155
  - `setCoreSettings(coreSettings)`
156
156
  - `toggleRewind(toggle)`
157
157
 
158
+ Local link play:
159
+
160
+ - `linkLocalStartSession(options)`
161
+ - `linkLocalStopSession()`
162
+ - `linkLocalSetActivePlayer(player)`
163
+ - `linkLocalGetStatus()`
164
+
158
165
  See `dist/mgba.d.ts` for full signatures and inline documentation.
159
166
 
160
167
  ## Source
package/dist/mgba.d.ts CHANGED
@@ -77,9 +77,19 @@ declare namespace mGBA {
77
77
 
78
78
  export type LinkPlayer = 1 | 2; // TODO: more than 2 player support
79
79
 
80
+ export type LinkLocalPlayerConfig = {
81
+ romPath: string;
82
+ savePath?: string;
83
+ };
84
+
85
+ export type LinkLocalStartSessionConfig = {
86
+ player1: LinkLocalPlayerConfig;
87
+ player2: LinkLocalPlayerConfig;
88
+ };
89
+
80
90
  export type LinkLocalStatus = {
81
91
  running: boolean;
82
- activePlayer: LinkPlayer | 0;
92
+ activePlayer?: LinkPlayer;
83
93
  };
84
94
 
85
95
  export type coreSettings = {
@@ -328,17 +338,12 @@ declare namespace mGBA {
328
338
  loadGame(romPath: string, savePathOverride?: string): boolean;
329
339
 
330
340
  /**
331
- * Starts a local linked GBA session. Version 1 supports two players.
341
+ * Starts a local linked GBA session, currently supports two players.
332
342
  */
333
- linkLocalStartSession(
334
- player1RomPath: string,
335
- player1SavePath: string | undefined,
336
- player2RomPath: string,
337
- player2SavePath?: string,
338
- ): boolean;
343
+ linkLocalStartSession(options: LinkLocalStartSessionConfig): boolean;
339
344
 
340
345
  /**
341
- * Stops the active local linked session.
346
+ * Stops the active local linked session, tears down the local link and running games.
342
347
  */
343
348
  linkLocalStopSession(): void;
344
349
 
@@ -348,7 +353,7 @@ declare namespace mGBA {
348
353
  linkLocalSetActivePlayer(player: LinkPlayer): void;
349
354
 
350
355
  /**
351
- * Gets the current local linked session status.
356
+ * Gets the current local linked session status, contains the active player and whether a local link is currently running.
352
357
  */
353
358
  linkLocalGetStatus(): LinkLocalStatus;
354
359
 
@@ -485,7 +490,7 @@ declare namespace mGBA {
485
490
  /**
486
491
  * Sets the main loop timing mode and value.
487
492
  *
488
- * See: https://emscripten.org/docs/api_reference/emscripten.h.html#c.emscripten_set_main_loop_timing
493
+ * See: [emscripten_set_main_loop_timing](https://emscripten.org/docs/api_reference/emscripten.h.html#c.emscripten_set_main_loop_timing)
489
494
  *
490
495
  * @param mode - Timing mode identifier.
491
496
  * @param value - Timing value associated with the mode.