@@ -17,125 +17,190 @@ public static class NESLib
17
17
/// <summary>
18
18
/// set bg and spr palettes, data is 32 bytes array
19
19
/// </summary>
20
- public static void pal_all ( byte [ ] data ) { }
20
+ public static void pal_all ( byte [ ] data ) => throw null ! ;
21
21
22
22
/// <summary>
23
23
/// set bg palette only, data is 16 bytes array
24
24
/// </summary>
25
- public static void pal_bg ( byte [ ] data ) { }
25
+ public static void pal_bg ( byte [ ] data ) => throw null ! ;
26
26
27
27
/// <summary>
28
28
/// set spr palette only, data is 16 bytes array
29
29
/// </summary>
30
- public static void pal_spr ( byte [ ] data ) { }
30
+ public static void pal_spr ( byte [ ] data ) => throw null ! ;
31
31
32
32
/// <summary>
33
33
/// set a palette entry, index is 0..31
34
34
/// </summary>
35
- public static void pal_col ( byte index , byte color ) { }
35
+ public static void pal_col ( byte index , byte color ) => throw null ! ;
36
36
37
37
/// <summary>
38
38
/// reset palette to $0f
39
39
/// </summary>
40
- public static void pal_clear ( ) { }
40
+ public static void pal_clear ( ) => throw null ! ;
41
41
42
42
/// <summary>
43
43
/// set virtual bright both for sprites and background, 0 is black, 4 is normal, 8 is white
44
44
/// </summary>
45
- public static void pal_bright ( byte bright ) { }
45
+ public static void pal_bright ( byte bright ) => throw null ! ;
46
46
47
47
/// <summary>
48
48
/// set virtual bright for sprites only
49
49
/// </summary>
50
- public static void pal_spr_bright ( byte bright ) { }
50
+ public static void pal_spr_bright ( byte bright ) => throw null ! ;
51
51
52
52
/// <summary>
53
53
/// set virtual bright for sprites background only
54
54
/// </summary>
55
- public static void pal_bg_bright ( byte bright ) { }
55
+ public static void pal_bg_bright ( byte bright ) => throw null ! ;
56
56
57
+ /// <summary>
58
+ /// play music
59
+ /// </summary>
60
+ public static void music_play ( byte song ) => throw null ! ;
61
+
62
+ /// <summary>
63
+ /// stop music
64
+ /// </summary>
65
+ public static void music_stop ( ) => throw null ! ;
66
+
67
+ /// <summary>
68
+ /// pause music
69
+ /// </summary>
70
+ public static void music_pause ( byte pause ) => throw null ! ;
71
+
72
+ /// <summary>
73
+ /// play sound effect
74
+ /// </summary>
75
+ public static void sfx_play ( byte sound , byte channel ) => throw null ! ;
57
76
77
+ /// <summary>
78
+ /// play sample
79
+ /// </summary>
80
+ public static void sample_play ( byte sample ) => throw null ! ;
58
81
82
+ /// <summary>
83
+ /// get pad trigger
84
+ /// </summary>
85
+ public static byte pad_trigger ( byte pad ) => throw null ! ;
59
86
87
+ /// <summary>
88
+ /// get pad state
89
+ /// </summary>
90
+ public static byte pad_state ( byte pad ) => throw null ! ;
91
+
92
+ /// <summary>
93
+ /// read from vram
94
+ /// </summary>
95
+ public static void vram_read ( byte [ ] dst , uint size ) => throw null ! ;
96
+
97
+ /// <summary>
98
+ /// write to vram
99
+ /// </summary>
100
+ public static void vram_write ( byte [ ] src , uint size ) => throw null ! ;
101
+
102
+ /// <summary>
103
+ /// unpack LZ4 data to vram
104
+ /// </summary>
105
+ public static void vram_unlz4 ( byte [ ] input , byte [ ] output , uint uncompressedSize ) => throw null ! ;
106
+
107
+ /// <summary>
108
+ /// fill memory
109
+ /// </summary>
110
+ public static void memfill ( object dst , byte value , uint len ) => throw null ! ;
111
+
112
+ /// <summary>
113
+ /// clear OAM buffer fast
114
+ /// </summary>
115
+ public static void oam_clear_fast ( ) => throw null ! ;
116
+
117
+ /// <summary>
118
+ /// set metasprite in OAM buffer with palette
119
+ /// </summary>
120
+ public static void oam_meta_spr_pal ( byte x , byte y , byte pal , byte [ ] metasprite ) => throw null ! ;
121
+
122
+ /// <summary>
123
+ /// set metasprite in OAM buffer with clipping
124
+ /// </summary>
125
+ public static void oam_meta_spr_clip ( int x , byte y , byte [ ] metasprite ) => throw null ! ;
60
126
61
127
/// <summary>
62
128
/// wait actual TV frame, 50hz for PAL, 60hz for NTSC
63
129
/// </summary>
64
- public static void ppu_wait_nmi ( ) { }
130
+ public static void ppu_wait_nmi ( ) => throw null ! ;
65
131
66
132
/// <summary>
67
133
/// wait virtual frame, it is always 50hz, frame-to-frame in PAL, frameskip in NTSC
68
134
/// </summary>
69
- public static void ppu_wait_frame ( ) { }
135
+ public static void ppu_wait_frame ( ) => throw null ! ;
70
136
71
137
/// <summary>
72
138
/// turn off rendering, nmi still enabled when rendering is disabled
73
139
/// </summary>
74
- public static void ppu_off ( ) { }
140
+ public static void ppu_off ( ) => throw null ! ;
75
141
76
142
/// <summary>
77
143
/// turn on bg, spr
78
144
/// </summary>
79
- public static void ppu_on_all ( ) { }
145
+ public static void ppu_on_all ( ) => throw null ! ;
80
146
81
147
/// <summary>
82
148
/// turn on bg only
83
149
/// </summary>
84
- public static void ppu_on_bg ( ) { }
150
+ public static void ppu_on_bg ( ) => throw null ! ;
85
151
86
152
/// <summary>
87
153
/// turn on spr only
88
154
/// </summary>
89
- public static void ppu_on_spr ( ) { }
155
+ public static void ppu_on_spr ( ) => throw null ! ;
90
156
91
157
/// <summary>
92
158
/// set PPU_MASK directly
93
159
/// </summary>
94
- public static void ppu_mask ( byte mask ) { }
160
+ public static void ppu_mask ( byte mask ) => throw null ! ;
95
161
96
162
/// <summary>
97
163
/// get current video system, 0 for PAL, not 0 for NTSC
98
164
/// </summary>
99
- public static byte ppu_system ( ) => default ;
165
+ public static byte ppu_system ( ) => throw null ! ;
100
166
101
167
/// <summary>
102
168
/// Return an 8-bit counter incremented at each vblank
103
169
/// </summary>
104
- public static byte nesclock ( ) => default ;
170
+ public static byte nesclock ( ) => throw null ! ;
105
171
106
172
/// <summary>
107
173
/// get the internal ppu ctrl cache var for manual writing
108
174
/// </summary>
109
- public static byte get_ppu_ctrl_var ( ) => default ;
175
+ public static byte get_ppu_ctrl_var ( ) => throw null ! ;
110
176
111
177
/// <summary>
112
178
/// set the internal ppu ctrl cache var for manual writing
113
179
/// </summary>
114
- public static void set_ppu_ctrl_var ( byte var ) { }
115
-
180
+ public static void set_ppu_ctrl_var ( byte var ) => throw null ! ;
116
181
117
182
/// <summary>
118
183
/// clear OAM buffer, all the sprites are hidden
119
184
/// </summary>
120
- public static void oam_clear ( ) { }
185
+ public static void oam_clear ( ) => throw null ! ;
121
186
122
187
/// <summary>
123
188
/// set sprite display mode, 0 for 8x8 sprites, 1 for 8x16 sprites
124
189
/// </summary>
125
- public static void oam_size ( byte size ) { }
190
+ public static void oam_size ( byte size ) => throw null ! ;
126
191
127
192
/// <summary>
128
193
/// set sprite in OAM buffer, chrnum is tile, attr is attribute, sprid is offset in OAM in bytes
129
194
/// </summary>
130
195
/// <returns>returns sprid+4, which is offset for a next sprite</returns>
131
- public static byte oam_spr ( byte x , byte y , byte chrnum , byte attr , byte sprid ) => default ;
196
+ public static byte oam_spr ( byte x , byte y , byte chrnum , byte attr , byte sprid ) => throw null ! ;
132
197
133
198
/// <summary>
134
199
/// poll controller and return enum like PAD.LEFT, etc.
135
200
/// </summary>
136
201
/// <param name="pad">pad number (0 or 1)</param>
137
202
/// <returns>Enum like PAD.LEFT, etc.</returns>
138
- public static PAD pad_poll ( byte pad ) => default ;
203
+ public static PAD pad_poll ( byte pad ) => throw null ! ;
139
204
140
205
/// <summary>
141
206
/// set metasprite in OAM buffer
@@ -144,59 +209,58 @@ public static void oam_size(byte size) { }
144
209
/// x=128 is end of a meta sprite
145
210
/// </summary>
146
211
/// <returns>returns sprid+4, which is offset for a next sprite</returns>
147
- public static byte oam_meta_spr ( byte x , byte y , byte sprid , byte [ ] data ) => default ;
212
+ public static byte oam_meta_spr ( byte x , byte y , byte sprid , byte [ ] data ) => throw null ! ;
148
213
149
214
/// <summary>
150
215
/// hide all remaining sprites from given offset
151
216
/// </summary>
152
- public static void oam_hide_rest ( byte sprid ) { }
153
-
217
+ public static void oam_hide_rest ( byte sprid ) => throw null ! ;
154
218
155
219
/// <summary>
156
220
/// set vram pointer to write operations if you need to write some data to vram
157
221
/// </summary>
158
- public static void vram_adr ( ushort adr ) { }
222
+ public static void vram_adr ( ushort adr ) => throw null ! ;
159
223
160
224
/// <summary>
161
225
/// put a byte at current vram address, works only when rendering is turned off
162
226
/// </summary>
163
- public static void vram_put ( byte n ) { }
227
+ public static void vram_put ( byte n ) => throw null ! ;
164
228
165
229
/// <summary>
166
230
/// fill a block with a byte at current vram address, works only when rendering is turned off
167
231
/// </summary>
168
- public static void vram_fill ( byte n , uint len ) { }
232
+ public static void vram_fill ( byte n , uint len ) => throw null ! ;
169
233
170
234
/// <summary>
171
235
/// set vram autoincrement, 0 for +1 and not 0 for +32
172
236
/// </summary>
173
- public static void vram_inc ( byte n ) { }
237
+ public static void vram_inc ( byte n ) => throw null ! ;
174
238
175
239
/// <summary>
176
240
/// write a block to current address of vram, works only when rendering is turned off
177
241
/// </summary>
178
- public static void vram_write ( string src ) { }
242
+ public static void vram_write ( string src ) => throw null ! ;
179
243
180
244
/// <summary>
181
245
/// write a block to current address of vram, works only when rendering is turned off
182
246
/// </summary>
183
- public static void vram_write ( byte [ ] src ) { }
247
+ public static void vram_write ( byte [ ] src ) => throw null ! ;
184
248
185
249
/// <summary>
186
250
/// unpack RLE data to current address of vram, mostly used for nametables
187
251
/// </summary>
188
- public static void vram_unrle ( byte [ ] data ) { }
252
+ public static void vram_unrle ( byte [ ] data ) => throw null ! ;
189
253
190
254
/// <summary>
191
255
/// delay for N frames
192
256
/// </summary>
193
- public static void delay ( byte frames ) { }
257
+ public static void delay ( byte frames ) => throw null ! ;
194
258
195
259
/// <summary>
196
260
/// set scroll, including rhe top bits
197
261
/// it is always applied at beginning of a TV frame, not at the function call
198
262
/// </summary>
199
- public static void scroll ( int x , int y ) { }
263
+ public static void scroll ( int x , int y ) => throw null ! ;
200
264
201
265
/// <summary>
202
266
/// set scroll after screen split invoked by the sprite 0 hit
@@ -205,36 +269,37 @@ public static void scroll(int x, int y) { }
205
269
/// otherwise empty frames without split will be inserted, resulting in jumpy screen
206
270
/// warning: only X scroll could be changed in this version
207
271
/// </summary>
208
- public static void split ( int x , int y ) { }
209
-
272
+ public static void split ( int x , int y ) => throw null ! ;
210
273
211
274
/// <summary>
212
275
/// select current chr bank for sprites, 0..1
213
276
/// </summary>
214
- public static void bank_spr ( byte n ) { }
277
+ public static void bank_spr ( byte n ) => throw null ! ;
215
278
216
279
/// <summary>
217
280
/// select current chr bank for background, 0..1
218
281
/// </summary>
219
- public static void bank_bg ( byte n ) { }
282
+ public static void bank_bg ( byte n ) => throw null ! ;
220
283
221
284
/// <summary>
222
285
/// get random number 0..255, same as rand8()
223
286
/// </summary>
224
- public static byte rand ( ) => default ;
287
+ public static byte rand ( ) => throw null ! ;
288
+
225
289
/// <summary>
226
290
/// get random number 0..255
227
291
/// </summary>
228
- public static byte rand8 ( ) => default ;
292
+ public static byte rand8 ( ) => throw null ! ;
293
+
229
294
/// <summary>
230
295
/// get random number 0..65535
231
296
/// </summary>
232
- public static ushort rand16 ( ) => default ;
297
+ public static ushort rand16 ( ) => throw null ! ;
233
298
234
299
/// <summary>
235
300
/// set random seed
236
301
/// </summary>
237
- public static void set_rand ( ushort seed ) { }
302
+ public static void set_rand ( ushort seed ) => throw null ! ;
238
303
239
304
/// <summary>
240
305
/// when display is enabled, vram access could only be done with this vram update system
@@ -253,14 +318,14 @@ public static void set_rand(ushort seed) { }
253
318
///
254
319
/// length of this data should be under 256 bytes
255
320
/// </summary>
256
- public static void set_vram_update ( byte [ ] buf ) { }
321
+ public static void set_vram_update ( byte [ ] buf ) => throw null ! ;
257
322
258
323
// all following vram functions only work when display is disabled
259
324
260
325
/// <summary>
261
326
/// do a series of VRAM writes, the same format as for set_vram_update, but writes done right away
262
327
/// </summary>
263
- public static void flush_vram_update ( byte [ ] buf ) { }
328
+ public static void flush_vram_update ( byte [ ] buf ) => throw null ! ;
264
329
265
330
// These are from: https://github.com/mhughson/attributes/blob/master/neslib.h
266
331
@@ -298,12 +363,12 @@ public static void flush_vram_update(byte[] buf) { }
298
363
/// <summary>
299
364
/// NOTE: this one is internal, not in neslib.h
300
365
/// </summary>
301
- internal static void pal_copy ( ) { }
366
+ internal static void pal_copy ( ) => throw null ! ;
302
367
303
368
/// <summary>
304
369
/// NOTE: this one is internal, not in neslib.h
305
370
/// </summary>
306
- internal static void ppu_onoff ( ) { }
371
+ internal static void ppu_onoff ( ) => throw null ! ;
307
372
308
373
// Tables are from: https://github.com/clbr/neslib/blob/master/neslib.sinc
309
374
0 commit comments