@orkosinha/gb-emu-devtools 0.2.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.
- package/README.md +44 -0
- package/gb_emu.d.ts +474 -0
- package/gb_emu.js +1369 -0
- package/gb_emu_bg.wasm +0 -0
- package/package.json +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# gb-emu
|
|
2
|
+
|
|
3
|
+
A cycle-accurate Game Boy and Game Boy Color emulator. Targets WebAssembly (via wasm-pack) and native platforms (via C FFI).
|
|
4
|
+
|
|
5
|
+
## Packages
|
|
6
|
+
|
|
7
|
+
| Package | Features | Use case |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `@orkosinha/gb-emu` | Core emulator | Production apps |
|
|
10
|
+
| `@orkosinha/gb-emu-devtools` | + Introspection API | Debuggers, dev tools |
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
### WASM
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @orkosinha/gb-emu
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
API: [`src/wasm.rs`](https://github.com/orkosinha/gb-emu/blob/main/src/wasm.rs)
|
|
21
|
+
|
|
22
|
+
### C FFI
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
cargo build --features ios --no-default-features --release
|
|
26
|
+
# outputs: target/release/libgb_emu.a + include/gb_emu.h
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
API: [`include/gb_emu.h`](https://github.com/orkosinha/gb-emu/blob/main/include/gb_emu.h)
|
|
30
|
+
|
|
31
|
+
### Rust
|
|
32
|
+
|
|
33
|
+
```toml
|
|
34
|
+
gb-emu = { git = "https://github.com/orkosinha/gb-emu" }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
API: [`src/core.rs`](https://github.com/orkosinha/gb-emu/blob/main/src/core.rs)
|
|
38
|
+
|
|
39
|
+
## Release
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
mise run setup:secrets # push NPM_TOKEN to GitHub (first time only)
|
|
43
|
+
mise run release -- 0.2.0 # bump version, tag, push → CI publishes both packages
|
|
44
|
+
```
|
package/gb_emu.d.ts
ADDED
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Game Boy joypad buttons.
|
|
6
|
+
*/
|
|
7
|
+
export enum Button {
|
|
8
|
+
A = 0,
|
|
9
|
+
B = 1,
|
|
10
|
+
Select = 2,
|
|
11
|
+
Start = 3,
|
|
12
|
+
Right = 4,
|
|
13
|
+
Left = 5,
|
|
14
|
+
Up = 6,
|
|
15
|
+
Down = 7,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class GameBoy {
|
|
19
|
+
free(): void;
|
|
20
|
+
[Symbol.dispose](): void;
|
|
21
|
+
apu_ch1_dac(): boolean;
|
|
22
|
+
apu_ch1_duty(): number;
|
|
23
|
+
apu_ch1_duty_pos(): number;
|
|
24
|
+
apu_ch1_enabled(): boolean;
|
|
25
|
+
apu_ch1_env_add(): boolean;
|
|
26
|
+
apu_ch1_env_period(): number;
|
|
27
|
+
apu_ch1_freq_hz(): number;
|
|
28
|
+
apu_ch1_freq_reg(): number;
|
|
29
|
+
apu_ch1_len_en(): boolean;
|
|
30
|
+
apu_ch1_length(): number;
|
|
31
|
+
apu_ch1_midi_note(): number;
|
|
32
|
+
/**
|
|
33
|
+
* CH1 shadow frequency register (internal sweep calculation state).
|
|
34
|
+
*/
|
|
35
|
+
apu_ch1_shadow_freq(): number;
|
|
36
|
+
apu_ch1_sweep_neg(): boolean;
|
|
37
|
+
apu_ch1_sweep_period(): number;
|
|
38
|
+
apu_ch1_sweep_shift(): number;
|
|
39
|
+
apu_ch1_volume(): number;
|
|
40
|
+
apu_ch2_dac(): boolean;
|
|
41
|
+
apu_ch2_duty(): number;
|
|
42
|
+
apu_ch2_duty_pos(): number;
|
|
43
|
+
apu_ch2_enabled(): boolean;
|
|
44
|
+
apu_ch2_env_add(): boolean;
|
|
45
|
+
apu_ch2_env_period(): number;
|
|
46
|
+
apu_ch2_freq_hz(): number;
|
|
47
|
+
apu_ch2_freq_reg(): number;
|
|
48
|
+
apu_ch2_len_en(): boolean;
|
|
49
|
+
apu_ch2_length(): number;
|
|
50
|
+
apu_ch2_midi_note(): number;
|
|
51
|
+
apu_ch2_volume(): number;
|
|
52
|
+
apu_ch3_dac(): boolean;
|
|
53
|
+
apu_ch3_enabled(): boolean;
|
|
54
|
+
apu_ch3_freq_hz(): number;
|
|
55
|
+
apu_ch3_freq_reg(): number;
|
|
56
|
+
apu_ch3_len_en(): boolean;
|
|
57
|
+
apu_ch3_length(): number;
|
|
58
|
+
apu_ch3_midi_note(): number;
|
|
59
|
+
apu_ch3_vol_code(): number;
|
|
60
|
+
apu_ch3_wave_pos(): number;
|
|
61
|
+
/**
|
|
62
|
+
* Raw wave RAM as 16 bytes (32 × 4-bit nibbles).
|
|
63
|
+
*/
|
|
64
|
+
apu_ch3_wave_ram(): Uint8Array;
|
|
65
|
+
apu_ch4_clock_div(): number;
|
|
66
|
+
apu_ch4_clock_shift(): number;
|
|
67
|
+
apu_ch4_dac(): boolean;
|
|
68
|
+
apu_ch4_enabled(): boolean;
|
|
69
|
+
apu_ch4_env_add(): boolean;
|
|
70
|
+
apu_ch4_env_period(): number;
|
|
71
|
+
apu_ch4_freq_hz(): number;
|
|
72
|
+
apu_ch4_len_en(): boolean;
|
|
73
|
+
apu_ch4_length(): number;
|
|
74
|
+
apu_ch4_lfsr(): number;
|
|
75
|
+
apu_ch4_lfsr_short(): boolean;
|
|
76
|
+
apu_ch4_volume(): number;
|
|
77
|
+
apu_frame_seq_step(): number;
|
|
78
|
+
/**
|
|
79
|
+
* NR50: master volume and VIN panning register.
|
|
80
|
+
*/
|
|
81
|
+
apu_nr50(): number;
|
|
82
|
+
/**
|
|
83
|
+
* NR51: left/right channel output routing mask.
|
|
84
|
+
*/
|
|
85
|
+
apu_nr51(): number;
|
|
86
|
+
/**
|
|
87
|
+
* NR52: APU power and channel-active status bits.
|
|
88
|
+
*/
|
|
89
|
+
apu_nr52(): number;
|
|
90
|
+
apu_powered(): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Pointer to the per-channel visualization ring buffer.
|
|
93
|
+
* Layout: 4 channels × 512 bytes; channel c starts at byte c × 512.
|
|
94
|
+
*/
|
|
95
|
+
apu_viz_ptr(): number;
|
|
96
|
+
/**
|
|
97
|
+
* Current write index within each channel's 512-byte slot (0–511).
|
|
98
|
+
*/
|
|
99
|
+
apu_viz_wp(): number;
|
|
100
|
+
/**
|
|
101
|
+
* Discard all samples from the buffer. Call once per frame after consuming.
|
|
102
|
+
*/
|
|
103
|
+
audio_clear_samples(): void;
|
|
104
|
+
/**
|
|
105
|
+
* Number of f32 values in the sample buffer (pairs × 2).
|
|
106
|
+
*/
|
|
107
|
+
audio_sample_buffer_len(): number;
|
|
108
|
+
/**
|
|
109
|
+
* Pointer to the interleaved stereo f32 sample buffer (L, R, L, R, …).
|
|
110
|
+
* Valid until the next `step_frame` or `step_samples` call.
|
|
111
|
+
*/
|
|
112
|
+
audio_sample_buffer_ptr(): number;
|
|
113
|
+
/**
|
|
114
|
+
* Target sample rate in Hz (44 100).
|
|
115
|
+
*/
|
|
116
|
+
audio_sample_rate(): number;
|
|
117
|
+
/**
|
|
118
|
+
* Current contrast level derived from the dither matrix (0–15, or −1 if unknown).
|
|
119
|
+
*/
|
|
120
|
+
camera_contrast(): number;
|
|
121
|
+
camera_live_len(): number;
|
|
122
|
+
/**
|
|
123
|
+
* Pointer to the camera live-view RGBA buffer (128×112×4 bytes).
|
|
124
|
+
*/
|
|
125
|
+
camera_live_ptr(): number;
|
|
126
|
+
/**
|
|
127
|
+
* Read a camera hardware register (index 0x00–0x7F → addresses 0xA000–0xA07F).
|
|
128
|
+
*/
|
|
129
|
+
camera_reg(index: number): number;
|
|
130
|
+
clear_serial_output(): void;
|
|
131
|
+
cpu_a(): number;
|
|
132
|
+
cpu_bc(): number;
|
|
133
|
+
cpu_de(): number;
|
|
134
|
+
cpu_f(): number;
|
|
135
|
+
cpu_halted(): boolean;
|
|
136
|
+
cpu_hl(): number;
|
|
137
|
+
cpu_ime(): boolean;
|
|
138
|
+
cpu_pc(): number;
|
|
139
|
+
cpu_sp(): number;
|
|
140
|
+
/**
|
|
141
|
+
* Decode a saved photo slot (1–30) to RGBA. Returns empty if unoccupied.
|
|
142
|
+
*/
|
|
143
|
+
decode_camera_photo(slot: number): Uint8Array;
|
|
144
|
+
frame_buffer_len(): number;
|
|
145
|
+
/**
|
|
146
|
+
* Pointer to the front frame buffer (160×144 RGBA pixels).
|
|
147
|
+
* Valid until the next `step_frame` call.
|
|
148
|
+
*/
|
|
149
|
+
frame_buffer_ptr(): number;
|
|
150
|
+
/**
|
|
151
|
+
* Colour of `color` (0–3) in BG palette `palette` (0–7) as 0xRRGGBB.
|
|
152
|
+
*/
|
|
153
|
+
get_bg_palette_color(palette: number, color: number): number;
|
|
154
|
+
get_cartridge_ram(): Uint8Array;
|
|
155
|
+
get_cartridge_ram_len(): number;
|
|
156
|
+
get_cartridge_ram_ptr(): number;
|
|
157
|
+
/**
|
|
158
|
+
* Lightweight status string: MBC type, ROM banks, LCDC, LY.
|
|
159
|
+
*/
|
|
160
|
+
get_debug_info(): string;
|
|
161
|
+
get_frame_count(): number;
|
|
162
|
+
get_instruction_count(): bigint;
|
|
163
|
+
/**
|
|
164
|
+
* Colour of `color` (0–3) in OBJ palette `palette` (0–7) as 0xRRGGBB.
|
|
165
|
+
*/
|
|
166
|
+
get_obj_palette_color(palette: number, color: number): number;
|
|
167
|
+
/**
|
|
168
|
+
* Serial output as a string (useful for test ROM output on 0xFF01/0xFF02).
|
|
169
|
+
*/
|
|
170
|
+
get_serial_output(): string;
|
|
171
|
+
/**
|
|
172
|
+
* BCPS: BG palette index (bit 7 = auto-increment, bits 5–0 = byte address).
|
|
173
|
+
*/
|
|
174
|
+
io_bcps(): number;
|
|
175
|
+
io_bgp(): number;
|
|
176
|
+
io_div(): number;
|
|
177
|
+
/**
|
|
178
|
+
* HDMA5: 0xFF = idle; otherwise H-blank DMA active, bits 6–0 = remaining blocks − 1.
|
|
179
|
+
*/
|
|
180
|
+
io_hdma5(): number;
|
|
181
|
+
io_ie(): number;
|
|
182
|
+
io_if(): number;
|
|
183
|
+
io_joypad(): number;
|
|
184
|
+
/**
|
|
185
|
+
* KEY1: speed-switch (bit 7 = current speed, bit 0 = armed).
|
|
186
|
+
*/
|
|
187
|
+
io_key1(): number;
|
|
188
|
+
io_lcdc(): number;
|
|
189
|
+
io_ly(): number;
|
|
190
|
+
io_lyc(): number;
|
|
191
|
+
io_obp0(): number;
|
|
192
|
+
io_obp1(): number;
|
|
193
|
+
/**
|
|
194
|
+
* OCPS: OBJ palette index (same layout as BCPS).
|
|
195
|
+
*/
|
|
196
|
+
io_ocps(): number;
|
|
197
|
+
/**
|
|
198
|
+
* OPRI: Object priority mode (bit 0: 0 = CGB coordinate, 1 = DMG OAM order).
|
|
199
|
+
*/
|
|
200
|
+
io_opri(): number;
|
|
201
|
+
io_scx(): number;
|
|
202
|
+
io_scy(): number;
|
|
203
|
+
io_stat(): number;
|
|
204
|
+
/**
|
|
205
|
+
* SVBK: current WRAM bank (1–7; 0 maps to 1).
|
|
206
|
+
*/
|
|
207
|
+
io_svbk(): number;
|
|
208
|
+
io_tac(): number;
|
|
209
|
+
io_tima(): number;
|
|
210
|
+
io_tma(): number;
|
|
211
|
+
/**
|
|
212
|
+
* VBK: current VRAM bank (0 or 1).
|
|
213
|
+
*/
|
|
214
|
+
io_vbk(): number;
|
|
215
|
+
io_wx(): number;
|
|
216
|
+
io_wy(): number;
|
|
217
|
+
is_camera(): boolean;
|
|
218
|
+
is_camera_ready(): boolean;
|
|
219
|
+
is_cgb_mode(): boolean;
|
|
220
|
+
is_mbc7(): boolean;
|
|
221
|
+
load_cartridge_ram(data: Uint8Array): void;
|
|
222
|
+
load_rom(rom_data: Uint8Array, cgb_mode: boolean): void;
|
|
223
|
+
log(msg: string): void;
|
|
224
|
+
log_vram_info(): void;
|
|
225
|
+
/**
|
|
226
|
+
* Convert a MIDI note number (0–127) to a name string like "C-4" or "A#3".
|
|
227
|
+
*/
|
|
228
|
+
static midi_to_note_name(note: number): string;
|
|
229
|
+
constructor();
|
|
230
|
+
ppu_cycles(): number;
|
|
231
|
+
ppu_line(): number;
|
|
232
|
+
ppu_mode(): number;
|
|
233
|
+
read_byte(addr: number): number;
|
|
234
|
+
read_range(addr: number, len: number): Uint8Array;
|
|
235
|
+
/**
|
|
236
|
+
* Read `len` bytes from VRAM bank `bank` (0 or 1) at `addr` (0x8000–0x9FFF).
|
|
237
|
+
* Does not modify VBK — safe to call at any time.
|
|
238
|
+
*/
|
|
239
|
+
read_vram_bank(bank: number, addr: number, len: number): Uint8Array;
|
|
240
|
+
/**
|
|
241
|
+
* Power-cycle: resets CPU, PPU, APU, timer, and MBC banking state.
|
|
242
|
+
* Save RAM is cleared; call `load_cartridge_ram` afterwards to restore it.
|
|
243
|
+
*/
|
|
244
|
+
reset(): void;
|
|
245
|
+
/**
|
|
246
|
+
* Deliver one byte as if sent by an external device on the serial link.
|
|
247
|
+
* Fires the serial interrupt (IF bit 3).
|
|
248
|
+
*/
|
|
249
|
+
serial_receive(byte: number): void;
|
|
250
|
+
/**
|
|
251
|
+
* Return and consume the oldest byte transmitted on the serial port,
|
|
252
|
+
* or `undefined` if nothing was sent.
|
|
253
|
+
*/
|
|
254
|
+
serial_take_output(): number | undefined;
|
|
255
|
+
/**
|
|
256
|
+
* Feed a tilt reading to the MBC7 accelerometer.
|
|
257
|
+
* `x`/`y` are signed offsets from flat; ±0x1000 ≈ ±1g.
|
|
258
|
+
*/
|
|
259
|
+
set_accelerometer(x: number, y: number): void;
|
|
260
|
+
set_button(button: Button, pressed: boolean): void;
|
|
261
|
+
/**
|
|
262
|
+
* Set camera image data from a live capture source.
|
|
263
|
+
* Expects 128×112 pixels as raw 8-bit grayscale (0 = black, 255 = white).
|
|
264
|
+
*/
|
|
265
|
+
set_camera_image(data: Uint8Array): void;
|
|
266
|
+
/**
|
|
267
|
+
* Run one full frame of emulation (~16.74 ms of Game Boy time).
|
|
268
|
+
*/
|
|
269
|
+
step_frame(): void;
|
|
270
|
+
/**
|
|
271
|
+
* Execute a single CPU instruction. Returns T-cycles consumed.
|
|
272
|
+
*/
|
|
273
|
+
step_instruction(): number;
|
|
274
|
+
/**
|
|
275
|
+
* Run until at least `n` stereo sample pairs are in the audio buffer.
|
|
276
|
+
* Returns the number of pairs actually generated.
|
|
277
|
+
*/
|
|
278
|
+
step_samples(n: number): number;
|
|
279
|
+
/**
|
|
280
|
+
* Update the camera live-view buffer. Returns true if the buffer changed.
|
|
281
|
+
*/
|
|
282
|
+
update_camera_live(): boolean;
|
|
283
|
+
/**
|
|
284
|
+
* Write one byte to cartridge SRAM at flat `.sav` offset `offset`,
|
|
285
|
+
* bypassing MBC bank selection.
|
|
286
|
+
*/
|
|
287
|
+
write_cartridge_ram(offset: number, value: number): void;
|
|
288
|
+
/**
|
|
289
|
+
* Write a contiguous slice to cartridge SRAM starting at flat offset `offset`.
|
|
290
|
+
*/
|
|
291
|
+
write_cartridge_ram_range(offset: number, data: Uint8Array): void;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Initialize panic hook for better error messages in WASM.
|
|
296
|
+
* Called automatically when the WASM module is instantiated.
|
|
297
|
+
*/
|
|
298
|
+
export function init_panic_hook(): void;
|
|
299
|
+
|
|
300
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
301
|
+
|
|
302
|
+
export interface InitOutput {
|
|
303
|
+
readonly memory: WebAssembly.Memory;
|
|
304
|
+
readonly __wbg_gameboy_free: (a: number, b: number) => void;
|
|
305
|
+
readonly gameboy_apu_ch1_dac: (a: number) => number;
|
|
306
|
+
readonly gameboy_apu_ch1_duty: (a: number) => number;
|
|
307
|
+
readonly gameboy_apu_ch1_duty_pos: (a: number) => number;
|
|
308
|
+
readonly gameboy_apu_ch1_enabled: (a: number) => number;
|
|
309
|
+
readonly gameboy_apu_ch1_env_add: (a: number) => number;
|
|
310
|
+
readonly gameboy_apu_ch1_env_period: (a: number) => number;
|
|
311
|
+
readonly gameboy_apu_ch1_freq_hz: (a: number) => number;
|
|
312
|
+
readonly gameboy_apu_ch1_freq_reg: (a: number) => number;
|
|
313
|
+
readonly gameboy_apu_ch1_len_en: (a: number) => number;
|
|
314
|
+
readonly gameboy_apu_ch1_length: (a: number) => number;
|
|
315
|
+
readonly gameboy_apu_ch1_midi_note: (a: number) => number;
|
|
316
|
+
readonly gameboy_apu_ch1_shadow_freq: (a: number) => number;
|
|
317
|
+
readonly gameboy_apu_ch1_sweep_neg: (a: number) => number;
|
|
318
|
+
readonly gameboy_apu_ch1_sweep_period: (a: number) => number;
|
|
319
|
+
readonly gameboy_apu_ch1_sweep_shift: (a: number) => number;
|
|
320
|
+
readonly gameboy_apu_ch1_volume: (a: number) => number;
|
|
321
|
+
readonly gameboy_apu_ch2_dac: (a: number) => number;
|
|
322
|
+
readonly gameboy_apu_ch2_duty: (a: number) => number;
|
|
323
|
+
readonly gameboy_apu_ch2_duty_pos: (a: number) => number;
|
|
324
|
+
readonly gameboy_apu_ch2_enabled: (a: number) => number;
|
|
325
|
+
readonly gameboy_apu_ch2_env_add: (a: number) => number;
|
|
326
|
+
readonly gameboy_apu_ch2_env_period: (a: number) => number;
|
|
327
|
+
readonly gameboy_apu_ch2_freq_hz: (a: number) => number;
|
|
328
|
+
readonly gameboy_apu_ch2_freq_reg: (a: number) => number;
|
|
329
|
+
readonly gameboy_apu_ch2_len_en: (a: number) => number;
|
|
330
|
+
readonly gameboy_apu_ch2_length: (a: number) => number;
|
|
331
|
+
readonly gameboy_apu_ch2_midi_note: (a: number) => number;
|
|
332
|
+
readonly gameboy_apu_ch2_volume: (a: number) => number;
|
|
333
|
+
readonly gameboy_apu_ch3_dac: (a: number) => number;
|
|
334
|
+
readonly gameboy_apu_ch3_enabled: (a: number) => number;
|
|
335
|
+
readonly gameboy_apu_ch3_freq_hz: (a: number) => number;
|
|
336
|
+
readonly gameboy_apu_ch3_freq_reg: (a: number) => number;
|
|
337
|
+
readonly gameboy_apu_ch3_len_en: (a: number) => number;
|
|
338
|
+
readonly gameboy_apu_ch3_length: (a: number) => number;
|
|
339
|
+
readonly gameboy_apu_ch3_midi_note: (a: number) => number;
|
|
340
|
+
readonly gameboy_apu_ch3_vol_code: (a: number) => number;
|
|
341
|
+
readonly gameboy_apu_ch3_wave_pos: (a: number) => number;
|
|
342
|
+
readonly gameboy_apu_ch3_wave_ram: (a: number) => [number, number];
|
|
343
|
+
readonly gameboy_apu_ch4_clock_div: (a: number) => number;
|
|
344
|
+
readonly gameboy_apu_ch4_clock_shift: (a: number) => number;
|
|
345
|
+
readonly gameboy_apu_ch4_dac: (a: number) => number;
|
|
346
|
+
readonly gameboy_apu_ch4_enabled: (a: number) => number;
|
|
347
|
+
readonly gameboy_apu_ch4_env_add: (a: number) => number;
|
|
348
|
+
readonly gameboy_apu_ch4_env_period: (a: number) => number;
|
|
349
|
+
readonly gameboy_apu_ch4_freq_hz: (a: number) => number;
|
|
350
|
+
readonly gameboy_apu_ch4_len_en: (a: number) => number;
|
|
351
|
+
readonly gameboy_apu_ch4_length: (a: number) => number;
|
|
352
|
+
readonly gameboy_apu_ch4_lfsr: (a: number) => number;
|
|
353
|
+
readonly gameboy_apu_ch4_lfsr_short: (a: number) => number;
|
|
354
|
+
readonly gameboy_apu_ch4_volume: (a: number) => number;
|
|
355
|
+
readonly gameboy_apu_frame_seq_step: (a: number) => number;
|
|
356
|
+
readonly gameboy_apu_nr50: (a: number) => number;
|
|
357
|
+
readonly gameboy_apu_nr51: (a: number) => number;
|
|
358
|
+
readonly gameboy_apu_nr52: (a: number) => number;
|
|
359
|
+
readonly gameboy_apu_powered: (a: number) => number;
|
|
360
|
+
readonly gameboy_apu_viz_ptr: (a: number) => number;
|
|
361
|
+
readonly gameboy_apu_viz_wp: (a: number) => number;
|
|
362
|
+
readonly gameboy_audio_clear_samples: (a: number) => void;
|
|
363
|
+
readonly gameboy_audio_sample_buffer_len: (a: number) => number;
|
|
364
|
+
readonly gameboy_audio_sample_buffer_ptr: (a: number) => number;
|
|
365
|
+
readonly gameboy_audio_sample_rate: (a: number) => number;
|
|
366
|
+
readonly gameboy_camera_contrast: (a: number) => number;
|
|
367
|
+
readonly gameboy_camera_live_len: (a: number) => number;
|
|
368
|
+
readonly gameboy_camera_live_ptr: (a: number) => number;
|
|
369
|
+
readonly gameboy_camera_reg: (a: number, b: number) => number;
|
|
370
|
+
readonly gameboy_clear_serial_output: (a: number) => void;
|
|
371
|
+
readonly gameboy_cpu_a: (a: number) => number;
|
|
372
|
+
readonly gameboy_cpu_bc: (a: number) => number;
|
|
373
|
+
readonly gameboy_cpu_de: (a: number) => number;
|
|
374
|
+
readonly gameboy_cpu_f: (a: number) => number;
|
|
375
|
+
readonly gameboy_cpu_halted: (a: number) => number;
|
|
376
|
+
readonly gameboy_cpu_hl: (a: number) => number;
|
|
377
|
+
readonly gameboy_cpu_ime: (a: number) => number;
|
|
378
|
+
readonly gameboy_cpu_pc: (a: number) => number;
|
|
379
|
+
readonly gameboy_cpu_sp: (a: number) => number;
|
|
380
|
+
readonly gameboy_decode_camera_photo: (a: number, b: number) => [number, number];
|
|
381
|
+
readonly gameboy_frame_buffer_len: (a: number) => number;
|
|
382
|
+
readonly gameboy_frame_buffer_ptr: (a: number) => number;
|
|
383
|
+
readonly gameboy_get_bg_palette_color: (a: number, b: number, c: number) => number;
|
|
384
|
+
readonly gameboy_get_cartridge_ram: (a: number) => [number, number];
|
|
385
|
+
readonly gameboy_get_cartridge_ram_len: (a: number) => number;
|
|
386
|
+
readonly gameboy_get_cartridge_ram_ptr: (a: number) => number;
|
|
387
|
+
readonly gameboy_get_debug_info: (a: number) => [number, number];
|
|
388
|
+
readonly gameboy_get_frame_count: (a: number) => number;
|
|
389
|
+
readonly gameboy_get_instruction_count: (a: number) => bigint;
|
|
390
|
+
readonly gameboy_get_obj_palette_color: (a: number, b: number, c: number) => number;
|
|
391
|
+
readonly gameboy_get_serial_output: (a: number) => [number, number];
|
|
392
|
+
readonly gameboy_io_bcps: (a: number) => number;
|
|
393
|
+
readonly gameboy_io_bgp: (a: number) => number;
|
|
394
|
+
readonly gameboy_io_div: (a: number) => number;
|
|
395
|
+
readonly gameboy_io_hdma5: (a: number) => number;
|
|
396
|
+
readonly gameboy_io_ie: (a: number) => number;
|
|
397
|
+
readonly gameboy_io_if: (a: number) => number;
|
|
398
|
+
readonly gameboy_io_joypad: (a: number) => number;
|
|
399
|
+
readonly gameboy_io_key1: (a: number) => number;
|
|
400
|
+
readonly gameboy_io_lcdc: (a: number) => number;
|
|
401
|
+
readonly gameboy_io_ly: (a: number) => number;
|
|
402
|
+
readonly gameboy_io_lyc: (a: number) => number;
|
|
403
|
+
readonly gameboy_io_obp0: (a: number) => number;
|
|
404
|
+
readonly gameboy_io_obp1: (a: number) => number;
|
|
405
|
+
readonly gameboy_io_ocps: (a: number) => number;
|
|
406
|
+
readonly gameboy_io_opri: (a: number) => number;
|
|
407
|
+
readonly gameboy_io_scx: (a: number) => number;
|
|
408
|
+
readonly gameboy_io_scy: (a: number) => number;
|
|
409
|
+
readonly gameboy_io_stat: (a: number) => number;
|
|
410
|
+
readonly gameboy_io_svbk: (a: number) => number;
|
|
411
|
+
readonly gameboy_io_tac: (a: number) => number;
|
|
412
|
+
readonly gameboy_io_tima: (a: number) => number;
|
|
413
|
+
readonly gameboy_io_tma: (a: number) => number;
|
|
414
|
+
readonly gameboy_io_vbk: (a: number) => number;
|
|
415
|
+
readonly gameboy_io_wx: (a: number) => number;
|
|
416
|
+
readonly gameboy_io_wy: (a: number) => number;
|
|
417
|
+
readonly gameboy_is_camera: (a: number) => number;
|
|
418
|
+
readonly gameboy_is_camera_ready: (a: number) => number;
|
|
419
|
+
readonly gameboy_is_cgb_mode: (a: number) => number;
|
|
420
|
+
readonly gameboy_is_mbc7: (a: number) => number;
|
|
421
|
+
readonly gameboy_load_cartridge_ram: (a: number, b: number, c: number) => void;
|
|
422
|
+
readonly gameboy_load_rom: (a: number, b: number, c: number, d: number) => [number, number];
|
|
423
|
+
readonly gameboy_log: (a: number, b: number, c: number) => void;
|
|
424
|
+
readonly gameboy_log_vram_info: (a: number) => void;
|
|
425
|
+
readonly gameboy_midi_to_note_name: (a: number) => [number, number];
|
|
426
|
+
readonly gameboy_new: () => number;
|
|
427
|
+
readonly gameboy_ppu_cycles: (a: number) => number;
|
|
428
|
+
readonly gameboy_ppu_line: (a: number) => number;
|
|
429
|
+
readonly gameboy_ppu_mode: (a: number) => number;
|
|
430
|
+
readonly gameboy_read_byte: (a: number, b: number) => number;
|
|
431
|
+
readonly gameboy_read_range: (a: number, b: number, c: number) => [number, number];
|
|
432
|
+
readonly gameboy_read_vram_bank: (a: number, b: number, c: number, d: number) => [number, number];
|
|
433
|
+
readonly gameboy_reset: (a: number) => void;
|
|
434
|
+
readonly gameboy_serial_receive: (a: number, b: number) => void;
|
|
435
|
+
readonly gameboy_serial_take_output: (a: number) => number;
|
|
436
|
+
readonly gameboy_set_accelerometer: (a: number, b: number, c: number) => void;
|
|
437
|
+
readonly gameboy_set_button: (a: number, b: number, c: number) => void;
|
|
438
|
+
readonly gameboy_set_camera_image: (a: number, b: number, c: number) => void;
|
|
439
|
+
readonly gameboy_step_frame: (a: number) => void;
|
|
440
|
+
readonly gameboy_step_instruction: (a: number) => number;
|
|
441
|
+
readonly gameboy_step_samples: (a: number, b: number) => number;
|
|
442
|
+
readonly gameboy_update_camera_live: (a: number) => number;
|
|
443
|
+
readonly gameboy_write_cartridge_ram: (a: number, b: number, c: number) => void;
|
|
444
|
+
readonly gameboy_write_cartridge_ram_range: (a: number, b: number, c: number, d: number) => void;
|
|
445
|
+
readonly init_panic_hook: () => void;
|
|
446
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
447
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
448
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
449
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
450
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
451
|
+
readonly __wbindgen_start: () => void;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
458
|
+
* a precompiled `WebAssembly.Module`.
|
|
459
|
+
*
|
|
460
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
461
|
+
*
|
|
462
|
+
* @returns {InitOutput}
|
|
463
|
+
*/
|
|
464
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
468
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
469
|
+
*
|
|
470
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
471
|
+
*
|
|
472
|
+
* @returns {Promise<InitOutput>}
|
|
473
|
+
*/
|
|
474
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|