@wasm-gaming/mgba-wasm 0.1.0

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.
@@ -0,0 +1,273 @@
1
+ export const DEFAULT_MGBA_OPTIONS = {
2
+ system: 'auto',
3
+ gbModel: 'auto',
4
+ idleOptimization: 'remove',
5
+ skipBios: true,
6
+ allowOpposingDirections: false,
7
+ renderFilter: 'pixelated',
8
+ aspect: 'native',
9
+ interframeBlending: false,
10
+ volume: 1.0,
11
+ gamepads: true,
12
+ logLevel: 'error',
13
+ escMenu: true,
14
+ };
15
+ /** Platform ids consumed by `mgbawasm_setup()` (mPLATFORM_* in core/core.h). */
16
+ export const MGBA_PLATFORM_IDS = {
17
+ auto: -1,
18
+ gba: 0,
19
+ gb: 1,
20
+ };
21
+ /** Values mGBA's `gb.model` config key takes; `auto` means "leave unset". */
22
+ export const MGBA_GB_MODEL_VALUES = {
23
+ auto: null,
24
+ dmg: 'DMG',
25
+ sgb: 'SGB',
26
+ cgb: 'CGB',
27
+ agb: 'AGB',
28
+ };
29
+ export const MGBA_LOG_LEVEL_IDS = {
30
+ off: 0,
31
+ error: 1,
32
+ debug: 2,
33
+ };
34
+ export const MGBA_OPTION_GROUPS = [
35
+ {
36
+ id: 'video',
37
+ label: 'Video',
38
+ options: [
39
+ {
40
+ key: 'renderFilter',
41
+ label: 'Image filtering',
42
+ description: 'Scaling filter applied when the picture is stretched to the canvas. Pixelated keeps pixel art crisp; smooth softens it.',
43
+ type: 'enum',
44
+ default: DEFAULT_MGBA_OPTIONS.renderFilter,
45
+ values: [
46
+ { value: 'pixelated', label: 'Pixelated' },
47
+ { value: 'smooth', label: 'Smooth' },
48
+ ],
49
+ },
50
+ {
51
+ key: 'aspect',
52
+ label: 'Aspect ratio',
53
+ description: 'Native is square pixels, as the handheld LCDs had them: 3:2 on GBA, 10:9 on Game Boy. 4:3 stretches the picture into a TV-shaped frame.',
54
+ type: 'enum',
55
+ default: DEFAULT_MGBA_OPTIONS.aspect,
56
+ values: [
57
+ { value: 'native', label: 'Native' },
58
+ { value: '4:3', label: '4:3' },
59
+ ],
60
+ },
61
+ {
62
+ key: 'interframeBlending',
63
+ label: 'Interframe blending',
64
+ description: 'Blend each frame with the previous one, approximating the ghosting of the original unlit LCD. Restores transparency effects that games drew by flickering sprites every other frame.',
65
+ type: 'boolean',
66
+ default: DEFAULT_MGBA_OPTIONS.interframeBlending,
67
+ },
68
+ ],
69
+ },
70
+ {
71
+ id: 'audio',
72
+ label: 'Audio',
73
+ options: [
74
+ {
75
+ key: 'volume',
76
+ label: 'Volume',
77
+ description: 'Master audio volume.',
78
+ type: 'number',
79
+ default: DEFAULT_MGBA_OPTIONS.volume,
80
+ values: [
81
+ { value: 0, label: 'Mute' },
82
+ { value: 0.25, label: '25%' },
83
+ { value: 0.5, label: '50%' },
84
+ { value: 0.75, label: '75%' },
85
+ { value: 1, label: '100%' },
86
+ ],
87
+ range: { minimum: 0, maximum: 1 },
88
+ },
89
+ ],
90
+ },
91
+ {
92
+ id: 'emulation',
93
+ label: 'Emulation',
94
+ options: [
95
+ {
96
+ key: 'system',
97
+ label: 'System',
98
+ description: 'Which core boots the ROM. Auto sniffs the image, which is right for every well-formed dump; force it for headerless or mislabelled files.',
99
+ type: 'enum',
100
+ default: DEFAULT_MGBA_OPTIONS.system,
101
+ requiresReset: true,
102
+ values: [
103
+ { value: 'auto', label: 'Auto' },
104
+ { value: 'gba', label: 'GBA' },
105
+ { value: 'gb', label: 'Game Boy' },
106
+ ],
107
+ },
108
+ {
109
+ key: 'gbModel',
110
+ label: 'Game Boy model',
111
+ description: 'Hardware the Game Boy core emulates. Auto follows the cartridge header. Ignored when a GBA ROM is loaded.',
112
+ type: 'enum',
113
+ default: DEFAULT_MGBA_OPTIONS.gbModel,
114
+ requiresReset: true,
115
+ values: [
116
+ { value: 'auto', label: 'Auto' },
117
+ { value: 'dmg', label: 'DMG' },
118
+ { value: 'sgb', label: 'Super GB' },
119
+ { value: 'cgb', label: 'Color' },
120
+ { value: 'agb', label: 'GBA' },
121
+ ],
122
+ },
123
+ {
124
+ key: 'idleOptimization',
125
+ label: 'Idle loops',
126
+ description: 'How the GBA core treats the busy-wait loops games spin in. Remove skips them and is where nearly all of the speed comes from; ignore emulates them cycle for cycle.',
127
+ type: 'enum',
128
+ default: DEFAULT_MGBA_OPTIONS.idleOptimization,
129
+ values: [
130
+ { value: 'remove', label: 'Remove' },
131
+ { value: 'detect', label: 'Detect' },
132
+ { value: 'ignore', label: 'Ignore' },
133
+ ],
134
+ },
135
+ {
136
+ key: 'skipBios',
137
+ label: 'Skip BIOS intro',
138
+ description: 'Jump straight into the game instead of playing the boot animation. Forced on when no BIOS image was supplied, since the built-in HLE BIOS has no intro.',
139
+ type: 'boolean',
140
+ default: DEFAULT_MGBA_OPTIONS.skipBios,
141
+ requiresReset: true,
142
+ },
143
+ ],
144
+ },
145
+ {
146
+ id: 'controllers',
147
+ label: 'Controllers',
148
+ options: [
149
+ {
150
+ key: 'allowOpposingDirections',
151
+ label: 'Opposing directions',
152
+ description: 'Let the D-pad report left+right (or up+down) at once. Real hardware cannot, and a few games misbehave when it happens.',
153
+ type: 'boolean',
154
+ default: DEFAULT_MGBA_OPTIONS.allowOpposingDirections,
155
+ },
156
+ {
157
+ key: 'gamepads',
158
+ label: 'Gamepads',
159
+ description: 'Poll connected gamepads (standard mapping) each frame.',
160
+ type: 'boolean',
161
+ default: DEFAULT_MGBA_OPTIONS.gamepads,
162
+ },
163
+ ],
164
+ },
165
+ {
166
+ id: 'debug',
167
+ label: 'Debug',
168
+ options: [
169
+ {
170
+ key: 'logLevel',
171
+ label: 'Core logging',
172
+ description: 'Core messages printed to the browser console: errors and warnings, or also its informational ones.',
173
+ type: 'enum',
174
+ default: DEFAULT_MGBA_OPTIONS.logLevel,
175
+ values: [
176
+ { value: 'off', label: 'Off' },
177
+ { value: 'error', label: 'Errors' },
178
+ { value: 'debug', label: 'Debug' },
179
+ ],
180
+ },
181
+ ],
182
+ },
183
+ ];
184
+ /** Flat view of every runtime-tweakable option across all groups. */
185
+ export const MGBA_ENGINE_OPTIONS = MGBA_OPTION_GROUPS.flatMap((group) => group.options);
186
+ const OPTION_BY_KEY = new Map(MGBA_ENGINE_OPTIONS.map((option) => [option.key, option]));
187
+ export function mgbaOption(key) {
188
+ return OPTION_BY_KEY.get(key);
189
+ }
190
+ /**
191
+ * Coerces a host- or storage-supplied value to what the option accepts,
192
+ * returning `undefined` when it is not a value the option can take. Numbers
193
+ * outside a `range` are clamped rather than rejected; enums are exact.
194
+ */
195
+ export function coerceOptionValue(option, value) {
196
+ if (option.type === 'boolean') {
197
+ return typeof value === 'boolean' ? value : undefined;
198
+ }
199
+ if (option.type === 'enum') {
200
+ const next = String(value);
201
+ return option.values.some((choice) => choice.value === next) ? next : undefined;
202
+ }
203
+ const next = typeof value === 'number' ? value : Number(value);
204
+ if (!Number.isFinite(next))
205
+ return undefined;
206
+ if (option.range) {
207
+ return Math.min(option.range.maximum, Math.max(option.range.minimum, next));
208
+ }
209
+ return option.values.some((choice) => choice.value === next) ? next : undefined;
210
+ }
211
+ /**
212
+ * Projects the catalog onto the shape `@wasm-gaming/engine-specs` (>=0.2.5)
213
+ * feeds its `esc-menu` component.
214
+ *
215
+ * The menu lives in the demo shell now, not in this package: the shell renders
216
+ * the rows and emits `option-change`, and the host writes the value back
217
+ * through `engine.config`. Since the component only draws chips for `boolean`
218
+ * and `enum`, numeric options are handed over as an enum of their menu choices
219
+ * — the numbers survive, because the chips compare values with `===`.
220
+ *
221
+ * Pass the running engine's `config.values()` so the menu opens on what the
222
+ * emulator is actually set to rather than on this package's defaults.
223
+ */
224
+ export function toEscMenuGroups(values = {}) {
225
+ return MGBA_OPTION_GROUPS.map((group) => ({
226
+ id: group.id,
227
+ label: group.label,
228
+ options: group.options.map((option) => ({
229
+ key: option.key,
230
+ label: option.label,
231
+ description: option.description,
232
+ type: option.type === 'boolean' ? 'boolean' : 'enum',
233
+ value: values[option.key] ?? option.default,
234
+ ...(option.type === 'boolean' ? {} : { values: option.values }),
235
+ ...(option.requiresReset ? { requiresReset: true } : {}),
236
+ })),
237
+ }));
238
+ }
239
+ // -------------------------------------------------------------- schema
240
+ function schemaForOption(option) {
241
+ if (option.type === 'boolean') {
242
+ return { type: 'boolean', default: option.default, description: option.description };
243
+ }
244
+ if (option.type === 'enum') {
245
+ return {
246
+ type: 'string',
247
+ enum: option.values.map((choice) => choice.value),
248
+ default: option.default,
249
+ description: option.description,
250
+ };
251
+ }
252
+ return {
253
+ type: option.integer ? 'integer' : 'number',
254
+ default: option.default,
255
+ ...(option.range
256
+ ? { minimum: option.range.minimum, maximum: option.range.maximum }
257
+ : { enum: option.values.map((choice) => choice.value) }),
258
+ description: option.description,
259
+ };
260
+ }
261
+ export const MGBA_OPTIONS_SCHEMA = {
262
+ type: 'object',
263
+ additionalProperties: false,
264
+ properties: {
265
+ ...Object.fromEntries(MGBA_ENGINE_OPTIONS.map((option) => [option.key, schemaForOption(option)])),
266
+ escMenu: {
267
+ type: 'boolean',
268
+ default: true,
269
+ description: "Show the demo shell's in-game settings menu when the player presses Escape.",
270
+ },
271
+ },
272
+ };
273
+ //# sourceMappingURL=mgba.options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mgba.options.js","sourceRoot":"","sources":["../../src/mgba.options.ts"],"names":[],"mappings":"AAsEA,MAAM,CAAC,MAAM,oBAAoB,GAA0B;IACzD,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,MAAM;IACf,gBAAgB,EAAE,QAAQ;IAC1B,QAAQ,EAAE,IAAI;IACd,uBAAuB,EAAE,KAAK;IAC9B,YAAY,EAAE,WAAW;IACzB,MAAM,EAAE,QAAQ;IAChB,kBAAkB,EAAE,KAAK;IACzB,MAAM,EAAE,GAAG;IACX,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,OAAO;IACjB,OAAO,EAAE,IAAI;CACd,CAAC;AAEF,gFAAgF;AAChF,MAAM,CAAC,MAAM,iBA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C,MAAM,CAAC,KAAK;YACd,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE;YAClE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1D,WAAW,EAAE,MAAM,CAAC,WAAW;KAChC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAe;IAC7C,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,GAAG,MAAM,CAAC,WAAW,CACnB,mBAAmB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAC3E;QACD,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,6EAA6E;SAC3F;KACF;CACF,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { EngineConfig, EngineInstance } from '@wasm-gaming/engine-specs';
2
+ import { manifest } from './mgba.manifest.js';
3
+ import { type MgbaConfig } from './mgba.config.js';
4
+ import { type EscMenuGroup } from './mgba.options.js';
5
+ export { manifest };
6
+ export type MgbaInstance = EngineInstance & {
7
+ /** Live handle on the emulator settings; writes apply to the running game. */
8
+ config: MgbaConfig;
9
+ /**
10
+ * The option rows for the demo shell's ESC menu, in the shape
11
+ * `@wasm-gaming/engine-specs` (>=0.2.5) renders. Snapshot at call time — read
12
+ * it when the menu opens, not once at boot.
13
+ */
14
+ escMenuGroups(): EscMenuGroup[];
15
+ /** Which core actually booted the ROM. */
16
+ system: 'gba' | 'gb';
17
+ };
18
+ export declare function load(config: EngineConfig): Promise<MgbaInstance>;
19
+ declare const _default: {
20
+ manifest: import("@wasm-gaming/engine-specs").EngineManifest;
21
+ load: typeof load;
22
+ };
23
+ export default _default;
24
+ //# sourceMappingURL=mgba.sdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mgba.sdk.d.ts","sourceRoot":"","sources":["../../src/mgba.sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,YAAY,EAEZ,cAAc,EAGf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAQL,KAAK,YAAY,EAMlB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,QAAQ,EAAE,CAAC;AAwOpB,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG;IAC1C,8EAA8E;IAC9E,MAAM,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,aAAa,IAAI,YAAY,EAAE,CAAC;IAChC,0CAA0C;IAC1C,MAAM,EAAE,KAAK,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,wBAAsB,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CA+qBtE;;;;;AAED,wBAAkC"}